-
Notifications
You must be signed in to change notification settings - Fork 29k
Open
flutter/packages
#9694Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listgood first issueRelatively approachable for first-time contributorsRelatively approachable for first-time contributorsp: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Description
While debugging the dashboard, I noticed Bad state: Future already completed
. In initWithParams
, the _initState
variable is set but not captured locally. If initWithParams
is called twice (my own bug), the completer gets overridden and then completed twice.
Potential solutions:
- capture the completer; before completing, test if capture != _initState, complete or complete with an error.
- initWithParams checks if _initState exists and awaits it before calling itself again
Meanwhile I'll still try to find out why our code is calling this twice...
stack:
Bad state: Future already completed
main.dart.mjs:59 at module0.Error._throwWithCurrentStackTrace (http://localhost:8080/main.dart.wasm:wasm-function[987]:0x178a1d)
at module0._AsyncCompleter.complete (body) (http://localhost:8080/main.dart.wasm:wasm-function[984]:0x1789a1)
at module0._AsyncCompleter.complete (unchecked entry) (http://localhost:8080/main.dart.wasm:wasm-function[1812]:0x188962)
at module0.GoogleSignInPlugin.initWithParams inner (http://localhost:8080/main.dart.wasm:wasm-function[29305]:0x3a9d70)
at module0._awaitHelper closure at org-dartlang-sdk:///dart-sdk/lib/_internal/wasm/lib/async_patch.dart:104:5 (http://localhost:8080/main.dart.wasm:wasm-function[1903]:0x189ded)
at module0.closure wrapper at org-dartlang-sdk:///dart-sdk/lib/_internal/wasm/lib/async_patch.dart:104:5 trampoline (http://localhost:8080/main.dart.wasm:wasm-function[1908]:0x189e87)
at module0._RootZone.runUnary (http://localhost:8080/main.dart.wasm:wasm-function[1284]:0x17fc5a)
at module0._FutureListener.handleValue (body) (http://localhost:8080/main.dart.wasm:wasm-function[1291]:0x17ff42)
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listgood first issueRelatively approachable for first-time contributorsRelatively approachable for first-time contributorsp: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team