Repository navigation
fix: keep the inbox skeleton while a re-import runs - #503
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
minSkeletonShownstarts fromvm.hasLoadedOnce || vm.settings.firstImportDone, andsyncDonestarts fromsettings.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:
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 tosyncProgress, the progress bar is still wired to it, and the flag-only gate is gone.scripts/test-inbox-skeleton.shseeds 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=0with an empty list.