Skip to content

feat(iOS): Toggle backup feature #455

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

Merged
merged 6 commits into from
Oct 21, 2020
Merged

feat(iOS): Toggle backup feature #455

merged 6 commits into from
Oct 21, 2020

Conversation

krizzu
Copy link
Member

@krizzu krizzu commented Oct 8, 2020

Summary:

Addressing #342

I could not reproduce this myself. Saving data, forcing iCloud backup, removing and installing again does not retain the data. This is mostly for anyone who can successfully reproduce the issue mentioned in #342.

Test Plan:

@krizzu krizzu added the platform: iOS This is iOS specific label Oct 8, 2020
@krizzu
Copy link
Member Author

krizzu commented Oct 13, 2020

@tido64 Thanks a lot for review 🙏 I'm closing this PR, because we're moving away to AsyncStorage organization

We're already moved 🧙‍♀️

@krizzu krizzu closed this Oct 13, 2020
@krizzu krizzu reopened this Oct 13, 2020
@fbartho
Copy link

fbartho commented Oct 14, 2020

@krizzu -- since this is a global setting, you could expose a native method in a header and allow people to configure the storage mode globally from their AppDelegate.m ? -- I think this is okay since this doesn't apply to Android.

Additionally, I think since this was a regression, the default should be "don't-store-in-backup" and instead people would have to opt-in to include AsyncStorage in Backup

Thoughts?

Feature flag "AsyncStorage_excludeFromBackup" in info.plist will
enable/disable exclusion from iCloud storage. Excluded by default.
@krizzu
Copy link
Member Author

krizzu commented Oct 15, 2020

@fbartho @tido64 I've added a feature flag (AsyncStorage_excludeFromBackup) to info.plist to be read by AsyncStorage. This is a boolean value to exclude/include AsyncStorage in iCloud backup. WDYT?

And I do agree, this should be excluded by default.

@tido64
Copy link
Member

tido64 commented Oct 15, 2020

I've added a feature flag (AsyncStorage_excludeFromBackup) to info.plist to be read by AsyncStorage.

I don't know how the community will use this feature (and how often it is used) so I'm fine with the current approach (for now 😏)

@krizzu
Copy link
Member Author

krizzu commented Oct 15, 2020

I don't know how the community will use this feature (and how often it is used) so I'm fine with the current approach (for now 😏)

I think that setting a feature flag in info.plist kinda mirrors the setting a feature flag in gradle.properties for Android specifics, hopefully.

How often? ¯_(ツ)_/¯ I I expect not at all, but let's just leave this as an option

Copy link

@fbartho fbartho left a comment

Choose a reason for hiding this comment

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

This looks great to me! I'd be happy to test a Beta Build if you want to publish one?

@krizzu
Copy link
Member Author

krizzu commented Oct 21, 2020

Going to do a release today - under a new org though, we need to deprecate old RNCommunity package

@krizzu krizzu merged commit 810e32a into master Oct 21, 2020
@krizzu krizzu deleted the disable-ios-backup branch January 18, 2021 10:38
craigzour pushed a commit to cds-snc/covid-alert-app that referenced this pull request Mar 29, 2021
…" to "@react-native-async-storage/async-storage ^1.9.0"

Remove the now unneeded @react-native-community+async-storage+1.9.0.patch - As per react-native-async-storage/async-storage#455 files should not be stored in iCloud backup by default
Results of yarn install
craigzour pushed a commit to cds-snc/covid-alert-app that referenced this pull request Mar 29, 2021
…" to "@react-native-async-storage/async-storage ^1.9.0"

Remove the now unneeded @react-native-community+async-storage+1.9.0.patch - As per react-native-async-storage/async-storage#455 files should not be stored in iCloud backup by default
Results of yarn install
craigzour pushed a commit to cds-snc/covid-alert-app that referenced this pull request Mar 31, 2021
…" to "@react-native-async-storage/async-storage ^1.9.0"

Remove the now unneeded @react-native-community+async-storage+1.9.0.patch - As per react-native-async-storage/async-storage#455 files should not be stored in iCloud backup by default
Results of yarn install
craigzour pushed a commit to cds-snc/covid-alert-app that referenced this pull request Apr 7, 2021
…" to "@react-native-async-storage/async-storage ^1.9.0"

Remove the now unneeded @react-native-community+async-storage+1.9.0.patch - As per react-native-async-storage/async-storage#455 files should not be stored in iCloud backup by default
Results of yarn install
craigzour pushed a commit to cds-snc/covid-alert-app that referenced this pull request Apr 7, 2021
…" to "@react-native-async-storage/async-storage ^1.9.0"

Remove the now unneeded @react-native-community+async-storage+1.9.0.patch - As per react-native-async-storage/async-storage#455 files should not be stored in iCloud backup by default
Results of yarn install
craigzour added a commit to cds-snc/covid-alert-app that referenced this pull request Apr 8, 2021
* Update the dependency "@react-native-community/async-storage": "1.9.0" to "@react-native-async-storage/async-storage ^1.9.0"
Remove the now unneeded @react-native-community+async-storage+1.9.0.patch - As per react-native-async-storage/async-storage#455 files should not be stored in iCloud backup by default
Results of yarn install

* Results of bundle install - with the move to react-native-async-storage

* Search/replace @react-native-community/async-storage with @react-native-async-storage/async-storage

* Update settings.gradle for the move to @react-native-async-storage

* Introduced KeyValueStore (with secure and unsecure implementation) in StorageService

* Introduced new StorageService (FutureStorageService as a temporary name)

* Replaced SecureKeyValueStore with new StorageService solution in MetricsService

* Replaced SecureKeyValueStore with new StorageService solution in OutbreakProvider

* Replaced RNSecureKeyStore with new StorageService solution in ExposureNotificationService

* Replaced RNSecureKeyStore with new StorageService solution in PollNotificationService

* Replaced AsyncStorage with new StorageService solution in existing StorageService

* Replaced AsyncStorage with new StorageService solution in BackendService

* Replaced AsyncStorage with new StorageService solution in ExposureNotificationService

* Replaced AsyncStorage with new StorageService solution in PollNotificationService

* Replaced AsyncStorage with new StorageService solution in OutbreakProvider

* Replaced AsyncStorage with new StorageService solution in many simple spots

* Added deleteAll function on new StorageService to plug it in the reset function of the debug menu

* Renamed StorageService to CachedStorageService and StorageServiceProvider to CachedStorageServiceProvider

* Renamed FutureStorageService to StorageService

* Added unit tests to new StorageService

Co-authored-by: Robert Shand <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: iOS This is iOS specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] AsyncStorage data persists after uninstalling and re-installing app
3 participants