-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[shared_preferences] Allow reading int as long in SharedPreferences #165781 #9032
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
Conversation
...roid/android/src/main/kotlin/io/flutter/plugins/sharedpreferences/SharedPreferencesPlugin.kt
Outdated
Show resolved
Hide resolved
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.
This changelog should be updated to follow the style guide
in particular using present tense. I also think it could be a bit more descriptive about what this fixes for users. Something like "Fixes a ClassCastException when using getInt to read a preference that was written on the native side.", if you think that accurately describes the fix.
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.
This changelog should give some of the context for when this happens. Something like
Enables callers to use `getInt` to read preference of type `int` that was written to shared preferences by java/kotlin code without passing though plugin code.
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.
Done
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.
Consider a comment documenting when we expect this to happen.
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.
Done
flutter/packages@2405f6a...431dc61 2025-04-09 [email protected] Manual roll Flutter from 02f13c3 to 212064a (21 revisions) (flutter/packages#9036) 2025-04-09 [email protected] [shared_preferences] Allow reading int as long in SharedPreferences #165781 (flutter/packages#9032) 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
flutter/packages@2405f6a...431dc61 2025-04-09 [email protected] Manual roll Flutter from 02f13c3 to 212064a (21 revisions) (flutter/packages#9036) 2025-04-09 [email protected] [shared_preferences] Allow reading int as long in SharedPreferences #165781 (flutter/packages#9032) 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
…165781 (flutter#9032) Resolves issue [#165781](flutter/flutter#165781) by falling back to reading preference as an int then upcasted to a Long. ## Pre-Review Checklist [^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.
…165781 (flutter#9032) Resolves issue [#165781](flutter/flutter#165781) by falling back to reading preference as an int then upcasted to a Long. ## Pre-Review Checklist [^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.
…165781 (flutter#9032) Resolves issue [#165781](flutter/flutter#165781) by falling back to reading preference as an int then upcasted to a Long. ## Pre-Review Checklist [^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.
…165781 (flutter#9032) Resolves issue [#165781](flutter/flutter#165781) by falling back to reading preference as an int then upcasted to a Long. ## Pre-Review Checklist [^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.
flutter/packages@2405f6a...431dc61 2025-04-09 [email protected] Manual roll Flutter from 02f13c3 to 212064a (21 revisions) (flutter/packages#9036) 2025-04-09 [email protected] [shared_preferences] Allow reading int as long in SharedPreferences flutter#165781 (flutter/packages#9032) 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
Resolves issue #165781 by falling back to reading preference as an int then upcasted to a Long.
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
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