Skip to content

fix: keep the inbox skeleton while a re-import runs - #503

Merged
an1ndra merged 1 commit into
Developfrom
fix/blank-while-importing
Nov 19, 2026
Merged

an1ndra merged 1 commit into
Developfrom
fix/blank-while-importing

Conversation

@an1ndra

@an1ndra an1ndra commented Nov 19, 2026

Copy link
Copy Markdown
Owner

What was wrong

After installing an update the inbox went black instead of showing the skeleton and progress bar it had shown before.

The loading gate was:

val loaded = minSkeletonShown && (syncDone || !readSmsAllowed)

minSkeletonShown starts from vm.hasLoadedOnce || vm.settings.firstImportDone, and syncDone starts from settings.firstImportDone — both persisted, so on an installation that has used the app before, both are true the moment the screen composes. The update then re-imports / migrates the database (a phone with 3,163 threads and ~95k messages does this for minutes), but the inbox had already declared itself loaded: the skeleton was skipped, the list was empty, and the progress bar had not started yet. On a dark theme that is a blank black screen.

The fix

The live sync state wins over the persisted flag:

val loaded = minSkeletonShown && syncProgress == null && (syncDone || !readSmsAllowed)

While a sync is in flight the skeleton and its progress bar stay on screen; when it ends the list replaces them. Applied to both the current and the legacy conversations screens, which shared the same gate.

Proof

JUnit InboxSkeletonTest — both screens keep the gate tied to syncProgress, the progress bar is still wired to it, and the flag-only gate is gone.

scripts/test-inbox-skeleton.sh seeds the post-update state (import marked done, database emptied) and asserts the loading state is visible while the import runs, then that the list replaces it. On the emulator the provider only holds a handful of messages, so the import can finish between dumps; the script reports that honestly rather than claiming a red/green it cannot see.

Verified on the device that reported it (Android 16, 3,163 threads): before the fix the screen showed nothing while the database was locked by the import; the counts logged at startup were total=3163 archived=0 blocked=0 with an empty list.

After an update the persisted "first import done" flag is already true, so the
inbox treated itself as loaded before the re-import started. The skeleton and
its progress bar were skipped and the list was empty for as long as the work
ran — on a phone with thousands of threads that is a blank screen, not a
loading one.

The live sync state now wins: while a sync is in flight the skeleton stays.
@an1ndra
an1ndra merged commit 7a6b0ab into Develop Nov 19, 2026
1 check passed
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.

1 participant