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

Fix that shared preferences use description strings instead of unique keys #454

Conversation

chrgernoe
Copy link
Member

@chrgernoe chrgernoe linked an issue Feb 18, 2024 that may be closed by this pull request
@chrgernoe chrgernoe requested a review from paetz February 18, 2024 20:58
@chrgernoe
Copy link
Member Author

chrgernoe commented Feb 18, 2024

We should also make the naming in the code consistent. Currently there are two different wordings:

  • settings
  • preferences

The Android library uses the the word preferences.

Created a new issue for this: #456

* Check whether the settings need to be migrated or not.
*/
private fun _checkForSettingsMigration() {
if (_customSettings.getInt(getString(R.string.pref_key_pref_version), 1) == 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it make more sense to check for the latest version? Otherwise, we would always need to remember adapting this line when we increase the version.

Copy link
Member Author

Choose a reason for hiding this comment

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

The point is that the migration is only necessary from the current format version 1 to the version 2, which is the format introduced with this PR. Assume, the user does not update its app and meanwhile we introduce another version with another migration path. In this scenario, we first need to migrate from 1 to 2 and afterwards from 2 to 3.

@paetz
Copy link
Collaborator

paetz commented Feb 20, 2024

This is a quite critical change. I suggest to trigger a dev release after merging it to have some more time for testing.

@chrgernoe chrgernoe force-pushed the bugfix/453-shared-preferences-uses-description-strings-instead-of-unique-keys branch from 32d9369 to bf83bbe Compare March 6, 2024 01:24
@chrgernoe chrgernoe marked this pull request as ready for review March 6, 2024 01:27
@chrgernoe chrgernoe requested a review from paetz March 6, 2024 01:28
@chrgernoe chrgernoe merged commit faf8f7a into master Mar 21, 2024
5 checks passed
@chrgernoe chrgernoe deleted the bugfix/453-shared-preferences-uses-description-strings-instead-of-unique-keys branch March 21, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shared preferences uses description strings instead of unique keys
2 participants