Skip to content

Conversation

@rafaeltonholo
Copy link
Member

Fixes #9825.

PR Description

This pull request addresses two related app crashes:

  1. During the database migration to version 90, the app attempts to fetch the IMAP prefix from the email server. If there is no connection available at that time, the migration throws an exception. This exception leads to the StoreSchemaDefinition wiping out all the database data by setting the db version to 0.

  2. When trying to open the app with no available folders, a crash occurs because the code assumes there is at least one folder in the list when creating the drawer instance. Since the database has been wiped, no folders are present, making it impossible to open the app.

This pull request resolves both issues by:

  1. Catching any IOException that occurs while attempting to fetch the IMAP prefix during the migration. If an exception is encountered, the data migration will be ignored.
  2. Allowing for the possibility of an empty list of folders when creating the drawer instance and using the default path delimiter in that case.

Steps to reproduce

  1. Uninstall the app
  2. git checkout dc3a253f6289cf45c737d49aa782a8a5bc69a714 (Revision before db migration 90)
  3. Build and install the app
  4. Setup an account
  5. Once you land in the Message List, turn off the Network and close the app.
  6. git switch main && git pull
  7. Build and install the app. Make sure the app gets updated.
  8. With NO network connection, open the app.

Expected behaviour

  1. The app should open without issues
  2. The data migration should be ignored
  3. The app's data stays the same as before the update happens.

Actual behaviour

The app crashes and wipes out the data.

@rafaeltonholo rafaeltonholo merged commit 058de77 into thunderbird:main Sep 19, 2025
15 checks passed
@rafaeltonholo rafaeltonholo deleted the fix/9825/fix-app-crash branch September 19, 2025 21:30
@thunderbird-botmobile thunderbird-botmobile bot added this to the Thunderbird 14 milestone Sep 19, 2025
rafaeltonholo added a commit to rafaeltonholo/thunderbird-android that referenced this pull request Sep 19, 2025
…pp-crash

fix: db migration to version 90 crashing the app and causing database wipe
rafaeltonholo added a commit to rafaeltonholo/thunderbird-android that referenced this pull request Sep 22, 2025
…pp-crash

fix: db migration to version 90 crashing the app and causing database wipe
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.

App crashes when upgrading from 13.0b1 to 13.0b2 and there is no connection when fetching IMAP prefix during the migration

2 participants