Skip to content

fix(backup): postpone the backup reminder after a collection export - #22895

Merged
mikehardy merged 1 commit into
ankidroid:mainfrom
criticalAY:fix/backup-reminder-after-export
Nov 3, 2026
Merged

mikehardy merged 1 commit into
ankidroid:mainfrom
criticalAY:fix/backup-reminder-after-export

Conversation

@criticalAY

Copy link
Copy Markdown
Contributor

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.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CI failure is caused by this PR

david-allison

This comment was marked as resolved.

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Nov 2, 2026
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
@criticalAY
criticalAY force-pushed the fix/backup-reminder-after-export branch from 7554854 to ca7953a Compare November 2, 2026 16:13
@criticalAY criticalAY removed the Needs Author Reply Waiting for a reply from the original author label Nov 2, 2026
@david-allison

This comment was marked as resolved.

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, cheers!

@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Nov 2, 2026
@criticalAY

Copy link
Copy Markdown
Contributor Author

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@mikehardy mikehardy added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Nov 3, 2026
@mikehardy
mikehardy added this pull request to the merge queue Nov 3, 2026
Merged via the queue into ankidroid:main with commit 4367a1b Nov 3, 2026
28 checks passed
@github-actions github-actions Bot added this to the 2.26 release milestone Nov 3, 2026
@criticalAY
criticalAY deleted the fix/backup-reminder-after-export branch November 3, 2026 06:01
@criticalAY criticalAY removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Nov 3, 2026
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.

The backup reminder dialog appeared even though I backed up today

3 participants