Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

Platform interface portion of #9846

Part of flutter/flutter#173924

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@stuartmorgan-g
Copy link
Collaborator Author

No changes from the main PR, which already has platform review, so @bparrishMines this just needs a sanity check.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the clearAuthorizationToken method across Android, iOS, and web platforms for the google_sign_in plugin. The Android implementation leverages the native clearToken API, the iOS version is a no-op as the SDK handles token invalidation automatically, and the web version clears a local token cache. The changes include necessary dependency updates, pigeon interface modifications, and tests for the new functionality. My feedback includes a suggestion to use a more conventional error code format in the Android implementation for better maintainability.

e ->
ResultUtilsKt.completeWithUnitError(
callback,
new FlutterError("clearAuthorizationToken failed", e.getMessage(), null)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The error code "clearAuthorizationToken failed" is rather long and descriptive for an error code. It's more conventional to use a short, machine-readable string (e.g., in snake_case or kebab-case). This would improve consistency with common error handling patterns and make it easier for clients to programmatically handle this specific error.

For instance, clearCredentialState uses "Clear Failed", which is shorter. A more structured code like clear_authorization_token_failed would be even better for consistency and parsing.

Suggested change
new FlutterError("clearAuthorizationToken failed", e.getMessage(), null)));
new FlutterError("clear_authorization_token_failed", e.getMessage(), null)));

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we ever start seeing this in practice, this should be switched over to using structured errors anyway; we don't want people doing programatic handling of error code strings that are already inconsistent within and across platform implementations (which is why the structured error guidance exists now). So I didn't worry about making this match anything.

Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web bits look good to me!

@stuartmorgan-g
Copy link
Collaborator Author

Oops, I forgot the main PR didn't have web approval; thanks for catching that and reviewing here!

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 17, 2025
@auto-submit auto-submit bot merged commit fdee698 into flutter:main Sep 17, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 17, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Sep 17, 2025
flutter/packages@0255ac9...fdee698

2025-09-17 [email protected] [google_sign_in] Implement
clearAuthorizationToken (flutter/packages#10024)
2025-09-17 [email protected] Roll Flutter (stable) from
a402d9a to d693b4b (6 revisions) (flutter/packages#10026)
2025-09-16 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.exifinterface:exifinterface from 1.3.7 to
1.4.1 in /packages/image_picker/image_picker_android/android
(flutter/packages#10008)
2025-09-16 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.code.gson:gson from 2.11.0 to 2.13.2 in
/packages/espresso/android (flutter/packages#10006)
2025-09-16 [email protected] Update web plugin owners
(flutter/packages#9994)
2025-09-16 [email protected] Roll Flutter from
29a238d to 8d0b31d (19 revisions) (flutter/packages#10019)

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] 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
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
flutter/packages@0255ac9...fdee698

2025-09-17 [email protected] [google_sign_in] Implement
clearAuthorizationToken (flutter/packages#10024)
2025-09-17 [email protected] Roll Flutter (stable) from
a402d9a to d693b4b (6 revisions) (flutter/packages#10026)
2025-09-16 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.exifinterface:exifinterface from 1.3.7 to
1.4.1 in /packages/image_picker/image_picker_android/android
(flutter/packages#10008)
2025-09-16 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.code.gson:gson from 2.11.0 to 2.13.2 in
/packages/espresso/android (flutter/packages#10006)
2025-09-16 [email protected] Update web plugin owners
(flutter/packages#9994)
2025-09-16 [email protected] Roll Flutter from
29a238d to 8d0b31d (19 revisions) (flutter/packages#10019)

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] 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
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
flutter/packages@0255ac9...fdee698

2025-09-17 [email protected] [google_sign_in] Implement
clearAuthorizationToken (flutter/packages#10024)
2025-09-17 [email protected] Roll Flutter (stable) from
a402d9a to d693b4b (6 revisions) (flutter/packages#10026)
2025-09-16 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.exifinterface:exifinterface from 1.3.7 to
1.4.1 in /packages/image_picker/image_picker_android/android
(flutter/packages#10008)
2025-09-16 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.code.gson:gson from 2.11.0 to 2.13.2 in
/packages/espresso/android (flutter/packages#10006)
2025-09-16 [email protected] Update web plugin owners
(flutter/packages#9994)
2025-09-16 [email protected] Roll Flutter from
29a238d to 8d0b31d (19 revisions) (flutter/packages#10019)

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] 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
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
flutter/packages@0255ac9...fdee698

2025-09-17 [email protected] [google_sign_in] Implement
clearAuthorizationToken (flutter/packages#10024)
2025-09-17 [email protected] Roll Flutter (stable) from
a402d9a to d693b4b (6 revisions) (flutter/packages#10026)
2025-09-16 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.exifinterface:exifinterface from 1.3.7 to
1.4.1 in /packages/image_picker/image_picker_android/android
(flutter/packages#10008)
2025-09-16 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.code.gson:gson from 2.11.0 to 2.13.2 in
/packages/espresso/android (flutter/packages#10006)
2025-09-16 [email protected] Update web plugin owners
(flutter/packages#9994)
2025-09-16 [email protected] Roll Flutter from
29a238d to 8d0b31d (19 revisions) (flutter/packages#10019)

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] 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants