Drop Facebook and guest sign-in; make a failed sign-in visible - #23
Merged
Merged
Conversation
The deployed demo offered three ways in and none of them worked. Facebook: no app id exists anywhere for the web build. `FacebookAuth.instance.login()` was never preceded by an `initialize(appId: ...)`, `web/index.html.template` has no fb-root or SDK script, and no app id appears in the deployed bundle. The button was incapable of completing a login for anyone. "Continue as guest": the Firebase project does not permit anonymous sign-in, so the door led to a failed sign-in rather than into the demo. Google: the only real path, and its failures were invisible. See below. Removed end to end: the buttons, the ApiEvents values, the bloc handlers, the repository methods and FacebookSignInException, lib/demo_config.dart, and the flutter_facebook_auth dependency together with the test-only flutter_facebook_auth_platform_interface pin that existed for its test. Why a failed Google sign-in looked like nothing happened: the failure was reported with `dart:developer log()`, which publishes to the Dart developer-event channel, and a released web build has no listener attached to it, so nothing reached the browser console. The handler then set the state back to ApiNoData -- the very screen the user was already standing on. Press the button: no popup, no error, no visible network activity. That is the reported symptom exactly. A failure now carries its reason. ApiNoData gained an optional `message`, StartupPage passes it to Introduction, and the screen renders it under the button. The error is also debugPrint()ed, which does reach the JS console in a release build. A dismissed popup, a rejected credential and a network failure are now distinguishable from the screen, without devtools. Verification: `flutter analyze` clean; 134 tests pass (two new bloc tests pin the failure contract, three new widget tests cover the rendered screen); `flutter build web --release` builds, and the built bundle contains no Facebook string and no guest button.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The deployed demo offered three ways in and none of them worked.
Facebook: no app id exists anywhere for the web build.
FacebookAuth.instance.login()was never preceded by aninitialize(appId: ...),web/index.html.templatehas no fb-root or SDK script, and no app id appears in the deployed bundle. The button was incapable of completing a login for anyone."Continue as guest": the Firebase project does not permit anonymous sign-in, so the door led to a failed sign-in rather than into the demo.
Google: the only real path, and its failures were invisible. See below.
Removed end to end: the buttons, the ApiEvents values, the bloc handlers, the repository methods and FacebookSignInException, lib/demo_config.dart, and the flutter_facebook_auth dependency together with the test-only flutter_facebook_auth_platform_interface pin that existed for its test.
Why a failed Google sign-in looked like nothing happened: the failure was reported with
dart:developer log(), which publishes to the Dart developer-event channel, and a released web build has no listener attached to it, so nothing reached the browser console. The handler then set the state back to ApiNoData -- the very screen the user was already standing on. Press the button: no popup, no error, no visible network activity. That is the reported symptom exactly.A failure now carries its reason. ApiNoData gained an optional
message, StartupPage passes it to Introduction, and the screen renders it under the button. The error is also debugPrint()ed, which does reach the JS console in a release build. A dismissed popup, a rejected credential and a network failure are now distinguishable from the screen, without devtools.Verification:
flutter analyzeclean; 134 tests pass (two new bloc tests pin the failure contract, three new widget tests cover the rendered screen);flutter build web --releasebuilds, and the built bundle contains no Facebook string and no guest button.