[shared_preferences] Allow reading int as long in SharedPreferences #165781#9032
Merged
auto-submit[bot] merged 1 commit intoflutter:mainfrom Apr 9, 2025
Merged
[shared_preferences] Allow reading int as long in SharedPreferences #165781#9032auto-submit[bot] merged 1 commit intoflutter:mainfrom
auto-submit[bot] merged 1 commit intoflutter:mainfrom
Conversation
gmackall
reviewed
Apr 8, 2025
...roid/android/src/main/kotlin/io/flutter/plugins/sharedpreferences/SharedPreferencesPlugin.kt
Outdated
Show resolved
Hide resolved
Member
There was a problem hiding this comment.
This changelog should be updated to follow the style guide
https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style
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.
gmackall
approved these changes
Apr 9, 2025
reidbaker
reviewed
Apr 9, 2025
Contributor
There was a problem hiding this comment.
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.
reidbaker
reviewed
Apr 9, 2025
Contributor
There was a problem hiding this comment.
Consider a comment documenting when we expect this to happen.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 9, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 9, 2025
github-merge-queue bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Apr 9, 2025
flutter/packages@2405f6a...431dc61 2025-04-09 engine-flutter-autoroll@skia.org Manual roll Flutter from 02f13c3 to 212064a (21 revisions) (flutter/packages#9036) 2025-04-09 muhatashim@google.com [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 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
github-merge-queue bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Apr 9, 2025
flutter/packages@2405f6a...431dc61 2025-04-09 engine-flutter-autoroll@skia.org Manual roll Flutter from 02f13c3 to 212064a (21 revisions) (flutter/packages#9036) 2025-04-09 muhatashim@google.com [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 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
nick-llewellyn
pushed a commit
to labrystechnology/flutter_packages
that referenced
this pull request
Apr 23, 2025
…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.
androidseb
pushed a commit
to androidseb/packages
that referenced
this pull request
Jun 8, 2025
…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.
FMorschel
pushed a commit
to FMorschel/packages
that referenced
this pull request
Jun 9, 2025
…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.
Ortes
pushed a commit
to Ortes/packages
that referenced
this pull request
Jun 25, 2025
…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.
romanejaquez
pushed a commit
to romanejaquez/flutter
that referenced
this pull request
Aug 14, 2025
flutter/packages@2405f6a...431dc61 2025-04-09 engine-flutter-autoroll@skia.org Manual roll Flutter from 02f13c3 to 212064a (21 revisions) (flutter/packages#9036) 2025-04-09 muhatashim@google.com [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 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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