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] Clean up pre-Pigeon code #6141

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

stuartmorgan
Copy link
Contributor

Internal native helper code was still using id arguments, doing type checking, and handling NSNull, none of which is relevant now that the calling code has been converted to Pigeon and is already strongly typed as NSString.

Pre-launch Checklist

Internal native helper code was still using `id` arguments, doing type
checking, and handling `NSNull`, none of which is relevant now that the
calling code has been converted to Pigeon and is already strongly typed
as `NSString`.
@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 to this rule, contact "@test-exemption-reviewer" in 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.

@stuartmorgan
Copy link
Contributor Author

test-exempt: code refactor with no semantic change

@stuartmorgan
Copy link
Contributor Author

I just happened to see this and it made me sad, so I thought I'd clean it up :)

- (GIDConfiguration *)configurationWithClientIdentifier:(NSString *)runtimeClientIdentifier
serverClientIdentifier:(NSString *)runtimeServerClientIdentifier
hostedDomain:(id)hostedDomain {
NSString *clientID = runtimeClientIdentifier ?: self.googleServiceProperties[kClientIdKey];
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you need to check if self.googleServiceProperties is null before getting a key from it? Wouldn't it error/crash if it's null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope! foo[bar] is just a shorthand for [foo objectForKeyedSubscript:bar], so standard messaging rules (a message to nil returns zero'd memory, nil in this case) apply.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Notice that the previous serverClientID code was actually already relying on that, so this code wasn't even consistent about the overkill 🙂)

Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

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

LGTM!

@stuartmorgan stuartmorgan added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 15, 2024
@auto-submit auto-submit bot merged commit e650b10 into flutter:main Feb 15, 2024
78 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 16, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 16, 2024
flutter/packages@ef349be...c56c12d

2024-02-16 [email protected] [tool] Add support for using a Kotlin test runner file (flutter/packages#6131)
2024-02-16 [email protected] [in_app_purchase] fix skerror nullability (flutter/packages#6139)
2024-02-15 [email protected] Explicitly pass the web renderer into the tests. (flutter/packages#6140)
2024-02-15 [email protected] [google_sign_in] Clean up pre-Pigeon code (flutter/packages#6141)
2024-02-15 [email protected] [local_auth] Add compatibility with latest `intl` (flutter/packages#6138)

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
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
Internal native helper code was still using `id` arguments, doing type checking, and handling `NSNull`, none of which is relevant now that the calling code has been converted to Pigeon and is already strongly typed as `NSString`.
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-ios platform-macos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants