Repository navigation
fix(backup): postpone the backup reminder after a collection export - #22895
Conversation
mikehardy
left a comment
There was a problem hiding this comment.
Assisted-by: composer-2.5
Thanks for the backup-prompt work.
GitHub required checks are not green: JUnit Tests (windows run 1) failed on BackupPromptDialogTest.sharing a collection package postpones the reminder — AssertionFailedError: expected android.intent.action.CHOOSER but was null at BackupPromptDialogTest.kt:87. That test is in this PR’s diff, so this is not the sparse single-OS unit flake bar. macOS and Ubuntu unit jobs passed; please fix or explain the Windows Robolectric/share intent path before merge.
david-allison
left a comment
There was a problem hiding this comment.
CI failure is caused by this PR
Saving or sharing an exported collection didn't count as a backup, so the "Backup your collection" reminder could show up right after one. A saved .colpkg now postpones it, the same as tapping Backup, and so does a shared one once another app is picked from the share sheet. Fixes 22893 Assisted-by: Claude Opus 5.5
7554854 to
ca7953a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
mikehardy
left a comment
There was a problem hiding this comment.
Assisted-by: Grok 4.7
Thank you — postponing the backup timer only after a real colpkg lands outside the app matches the export flow.
Locally I rebased onto main without force-pushing (prep stayed at the PR tip). I ran lint (lintAll, ktlintCheck, lint-rules:test), unit tests (jacocoUnitTestReport), and release emulator tests (TEST_RELEASE_BUILD=true via run_emulator_tests.py on emulator-5556 / API35_GAPI); all passed.
Reviewed ExportSharedReceiver reading EXTRA_CHOSEN_COMPONENT, ignoring in-app targets, onFileExported on profile-wrapped prefs, and tests that opening the chooser alone does not clear the reminder.
some acceptable findings, no action required, just leaving for posterity: commit subject length; pending intent request code 0 on overlapping shares.
Note
Assisted-by: Opus 5.5
Purpose / Description
The "Backup your collection" reminder could pop up right after a backup. Its timer only moved when the reminder's own Backup or Later buttons were tapped, so exporting the collection from the menu and saving it didn't count.
Fixes
Approach
Saving or sharing an exported collection package (.colpkg) now postpones the reminder the same way tapping Backup does.
How Has This Been Tested?
Emulator, API 31: export the collection with media, save it to Downloads, close the app from Recents and reopen it
Before
issue-22893-before.mp4
After
issue-22893-after.mp4
Learning (optional, can help others)
Backups from Create backup live in the app's own folder, which Android deletes on uninstall, so they don't protect against the data loss this reminder warns about.
Checklist
Please, go through these checks before submitting the PR.