-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gsi_web] Do not initialize CodeClient if scopes are empty. #5537
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't paged the whole flow back in here, but what if someone creates with no scopes, but then adds scopes later. Shouldn't we create the client then? Or does that already happen?
This is not happening right now, but YES, it seems that for incremental authorization you're supposed to re-create the client every time. This was not clear while developing this, because For now, clients will have to pass the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with TODO nit.
@stuartmorgan if all the pre-submit tests pass I'm going to land this with the tree on red. I don't think it's going to fix the tree, but... it might kick a lucky build and fix. That way we can continue working on google_sign_in_web without worrying about publishing the bad version (the migration to |
flutter/packages@bc72d15...5d9874f 2023-12-02 [email protected] Roll Flutter from 918e336 to d861ce4 (29 revisions) (flutter/packages#5542) 2023-12-02 [email protected] [gsi_web] Do not initialize CodeClient if scopes are empty. (flutter/packages#5537) 2023-12-01 [email protected] Reenable macOS 13 tests (flutter/packages#5494) 2023-12-01 [email protected] [flutter_image] Adopt code excerpts in README (flutter/packages#5498) 2023-11-30 [email protected] [cross_file] Migrate to pkg:web, bump min SDK to Dart 3.2 (flutter/packages#5520) 2023-11-30 [email protected] [google_maps_flutter] Add support for version 8 of the iOS SDK (flutter/packages#5528) 2023-11-30 [email protected] [pointer_interceptor] Re-land: Add platform interface (flutter/packages#5525) 2023-11-30 [email protected] [google_sign_in] Add server auth code retrieval to gis_client (flutter/packages#5358) 2023-11-30 [email protected] Roll Flutter from 5e5b529 to 918e336 (14 revisions) (flutter/packages#5526) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…5537) When initializing a `CodeClient`, it is mandatory to pass at least one `scope` (or the JS initialization will crash). This PR ensures that the `CodeClient` is not created unless `initialScopes.isNotEmpty`, and lets the user know when attempting to use said client that it hasn't been initialized properly. ## Issues * Fixes: flutter/flutter#139382 * Fixes: flutter/flutter#62474 * Closes: flutter/cocoon#3304 (makes this PR unneeded) ## Tests * Tested locally with `cocoon`.
…5537) When initializing a `CodeClient`, it is mandatory to pass at least one `scope` (or the JS initialization will crash). This PR ensures that the `CodeClient` is not created unless `initialScopes.isNotEmpty`, and lets the user know when attempting to use said client that it hasn't been initialized properly. ## Issues * Fixes: flutter/flutter#139382 * Fixes: flutter/flutter#62474 * Closes: flutter/cocoon#3304 (makes this PR unneeded) ## Tests * Tested locally with `cocoon`.
When initializing a
CodeClient
, it is mandatory to pass at least onescope
(or the JS initialization will crash).This PR ensures that the
CodeClient
is not created unlessinitialScopes.isNotEmpty
, and lets the user know when attempting to use said client that it hasn't been initialized properly.Issues
Tests
cocoon
.Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.