-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Scoped storage migration #3396
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
Scoped storage migration #3396
Conversation
JuancaG05
left a comment
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.
Some tiny suggestions @abelgardep, great job! 💯
...App/src/main/java/com/owncloud/android/presentation/ui/migration/StorageMigrationActivity.kt
Outdated
Show resolved
Hide resolved
...p/src/main/java/com/owncloud/android/presentation/viewmodels/migration/MigrationViewModel.kt
Outdated
Show resolved
Hide resolved
owncloudData/src/main/java/com/owncloud/android/data/storage/LocalStorageProvider.kt
Show resolved
Hide resolved
owncloudData/src/main/java/com/owncloud/android/data/storage/LegacyStorageProvider.kt
Show resolved
Hide resolved
owncloudData/src/main/java/com/owncloud/android/data/storage/ScopedStorageProvider.kt
Show resolved
Hide resolved
fesave
left a comment
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.
Great job!!! Congratulations!!! 🥇
JuancaG05
left a comment
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.
💯
(1) [WONT FIX]
Current: in 1st slide, the Expected: Pixel 2 Android 11 |
(2) [WONT FIX]How important is the
How complex is this to implement? Is it technically correct keep using legacy storage when the app points to Android 11 SDK? The "longer transition period" should not be very long, because all apps must do the update. Therefore, if we have to implement a complex logic to delay the migration, it would not be worthy because they will be updated soon. More ideas welcome. |
|
Related to (2), if we have a Imagine that you do want to perform the migration later, new files will be downloaded to the scoped storage. Maybe there are some with the same hierarchy in the legacy one. After that, if we try to migrate, those files to scoped storage, some conflicts could appear. We won't have full control over the files if we add a remind me later option |
Is this ok for you to skip the "Remind later" option and perform migration just in the moment of the app upgrade? @theScrabi @michaelstingl @tbsbdr @JuancaG05 @fesave Pros of removing "Remind me later": easier technically to implement (already done). Don't letting user to decide is straightforward and avoid confusions. Only one direction. Pros of keeping "Remind me later": user decides when to upgrade. Contras of keeping "Remind me later": More work to do, closer to the deadline. Users will have to wait for other apps to implement SAF inside (from November on, without Scoped Storage and SAF, not posible to update in Google Play) and could forget to trigger the migration. Conflicts can happen, because we will not maintain the legacy data anymore, causing a bigger problem. |
I also prefer the simplicity of this approach. |
(3)Check this out: When the wizard is displayed after upgrading:
As this is a corner case, it could happen only in case the device is running out of battery (we can guess the user will not power off the device at this moment). From my side, it does not make sense to develop a mechanism to prevent such scenario, but it could be interesting to add in the first slide a recommendation like "please don't switch your device off. If your battery is low, please plug it on before continuing the process" what do you think? |
(4) [FIXED]
Current: When the migration finishes, all av. offline files and folder are queued in uploads view to upload to the server Expected: Nothing changed, nothing should be uploaded Pixel2 Android11 |
|
Question -> Are log files migrated? @abelgardep |
Yes, they should, right? The point here is that in 2.18.1, logs are not stored inside a logs folder, they were directly in the root folder and they are migrated to the root folder instead of a logs folder and they won't be detected by the logs collector 🤔 |
Migrating the files from legacy to scoped storage, at the moment, does not preserve copied file attributes such as creation/modification date, permissions, etc. This is a problem for the AvOffline service since it compares the last modification timestamp in the local file with the last time we get data from the server. It means that it detects that something changed in the local storage and it enqueues a new upload. There are two potential ways to fix this.
The second one could be a good option since we will store the files in the scoped storage and other apps won't be able to modify them. The only way to modify files within scoped storage will be using the documents provider and it already performs a synchronization. |
(5)
Current: device runs into disk issues, and finally the app crashes Is there any way to prevent the keep option if there is no enough space in the device?
|
I'd go for 2, if the following steps pass:
|
(6) [FIXED]as discussed above
we'd go for an approach in which log files (out of the logs folder) will not be migrated. Log files are removed after a week and the content could be reproduced again. Otherwise, old logs will not be removed by the logs collector. |
(8)Finished uploads are lost in the uploads view after migrating, that means:
Current: Uploads view is empty Expected: Finished uploads in the list Is there any regard in the migration? afaik, the list of finished uploads is stored in DB. Nexus 6P v7 |
Yes, I clean the finished uploads when migration is done. That way I just need to update where the pending uploads are stored. |
2a6a99a to
46f0deb
Compare
bb166e2 to
818a5a9
Compare
|
Related to (5): Two scenarios
|
46f0deb to
24621a6
Compare
43168bd to
bd89c41
Compare
Text for version without "Keep old data"Plaintext(thx @mcarioscio-ownCloud for your review!) Updated Text is italic Text:
@abelgardep if the text is okay for you, could you please update the text in the wizard? |
|
Regarding (5), i ran into space issues
Current: app crashes. After the crash:
It seems that the old files were not removed at the time they were totally copied. Expected: every file is copied to Scoped Storage and then, removed from legacy storage. Nexus6P Android7 |
(11)
Current: some downloaded files are displayed as repeated. Pixel2 v11
|
…e space is not enough during migration.
|
Regarding (5) With the latest commit 9GB available in device So, we have only ~2GB available Migration After migration: 5GB file is downloaded (green mark) But, checking the Device explorer: 1GB files are complete is there any way to remove pieces of file that were not totally migrated? |
…when migration fails.
|
SonarCloud Quality Gate failed.
|
|
Everything fixed, ready to go! |














Related Issues
App: #3327
Library PR (if needed): owncloud/android-library#436
QA
Test plan: https://github.com/owncloud/QA/blob/master/Mobile/Android/Release_2.19/Scoped%20Storage%20Migration.md
Reports:
owncloudfolder stays in legacy storage Scoped storage migration #3396 (comment) [FIXED]