Skip to content
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

[google_sign_in] Update Pigeon for non-nullable generics #7785

Merged

Conversation

stuartmorgan
Copy link
Contributor

@stuartmorgan stuartmorgan commented Oct 3, 2024

Updates the Pigeon definition to uses non-nullable generics now that it's possible.

In practice for this plugin it's currently a no-op: the only affected collection is passed from Dart to native, on the Dart side the source was already a List<String>, and on the native side we are using languages without nullability support in generics (Java and Obj-C). However, to do this now eliminates tech debt, and will avoid problems if/when the native side switches to Kotlin/Swift.

The Android implementation required some non-trivial changes to adapt to an earlier Pigeon change that we hadn't picked up yet, which was the change from Result<Void> (which turned out to be incompatible with Kotlin) to the separate VoidResult class.

Part of flutter/flutter#155891

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

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. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@stuartmorgan
Copy link
Contributor Author

test-exempt: code refactor with no semantic change

@stuartmorgan stuartmorgan marked this pull request as ready for review October 4, 2024 13:49
@stuartmorgan
Copy link
Contributor Author

This is ready for review now; the PR description has been updated to explain the Android changes.

* handles converting any FlutterErrors (or other {@code Throwable}s in case any non- FlutterError
* exceptions slip through) thrown by the new code paths into {@code error} callbacks.
*/
private abstract static class ErrorConvertingMethodChannelVoidResult
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a duplicate of the class below, but adjusted to implement VoidResult.

@@ -720,32 +744,35 @@ private void finishWithUserData(Messages.UserData data) {
}

private void finishWithError(String errorCode, String errorMessage) {
Messages.Result<?> result;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This had to be restructured because voidResult is no longer assignable to Result<T>.

Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

Lgtm! Thanks for the detailed explanation :)

@stuartmorgan stuartmorgan added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2024
@auto-submit auto-submit bot merged commit bb00d34 into flutter:main Oct 7, 2024
76 checks passed
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 7, 2024
flutter/packages@05bf1d4...bb00d34

2024-10-07 stuartmorgan@google.com [google_sign_in] Update Pigeon for non-nullable generics (flutter/packages#7785)
2024-10-07 stuartmorgan@google.com [path_provider] Update Android Pigeon for non-nullable generics  (flutter/packages#7783)
2024-10-07 victoreronmosele@gmail.com [rfw] Increase tolerance for material widget tests (flutter/packages#7148)
2024-10-05 stuartmorgan@google.com [various] Update Java compatibility version to 11 (flutter/packages#7795)
2024-10-04 stuartmorgan@google.com [video_player] Update Pigeon for non-nullable generics (flutter/packages#7790)
2024-10-04 tobias@leafnode.se [go_router] Added missing implementation for the routerNeglect parameter in GoRouter (flutter/packages#7752)
2024-10-04 109111084+yaakovschectman@users.noreply.github.com [google_maps_flutter_platform_interface] Convert `BitmapDescriptor` to typesafe subclasses (flutter/packages#7699)
2024-10-04 109111084+yaakovschectman@users.noreply.github.com [google_maps_flutter_platform_interface] Convert `PatternItem` and `Cap` to typesafe structures. (flutter/packages#7703)

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 flutter-ecosystem@google.com 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
autosubmit Merge PR when tree becomes green via auto submit App p: google_sign_in platform-android platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants