Skip to content

fix: handle nonfatal review reminder deserialization errors on startup#20462

Closed
naurakrbna wants to merge 1 commit intoankidroid:mainfrom
naurakrbna:fix/nonfatal-review-reminder-startup-error
Closed

fix: handle nonfatal review reminder deserialization errors on startup#20462
naurakrbna wants to merge 1 commit intoankidroid:mainfrom
naurakrbna:fix/nonfatal-review-reminder-startup-error

Conversation

@naurakrbna
Copy link

@naurakrbna naurakrbna commented Mar 14, 2026

fix: handle nonfatal review reminder deserialization errors on startup. At present, corrupt review reminder data in SharedPreferences can't be deserialized, the app crashes on startup. This catches the exception in scheduleAllEnabledReviewReminderNotifications and shows a toast instead, so the app can continue starting up normally.

Changes:

  • AlarmManagerService.kt: catch SerializationException and
    IllegalArgumentException when reading from ReviewRemindersDatabase,
    show toast on failure
  • 03-dialogs.xml: add boot_service_review_reminders_corrupt string
  • AlarmManagerServiceTest.kt: test that corrupt data doesn't crash and
    shows toast

When review reminder data stored in SharedPreferences cannot be
deserialized (e.g. due to a schema mismatch), catch the exception
and notify the user via a toast instead of crashing the app.

Closes ankidroid#20168
Fixes ankidroid#20163

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Important

Maintainers: This PR contains Strings changes

  1. Sync Translations before merging this PR and wait for the action to complete
  2. Review and merge the auto-generated PR in order to sync all user-submitted translations
  3. Sync Translations again and merge the PR so the huge automated string changes caused by merging this PR are by themselves and easy to review

@lukstbit
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants