fix(inbox): show the spinner while a concurrent fetch is still running - #800
Merged
Merged
Conversation
A poll-driven templates/branding fetch already in flight makes the overlay's load() return on the repository's in-flight guard before anything is cached, so it reported a settled Hidden with loading=false. InboxListContent renders nothing for Hidden, leaving the panel blank until observeContentChanges fires rather than showing the loading state. load() now reports loading when the inbox is not yet renderable AND a fetch is still running, matching iOS, which sets .loading before it fetches so a concurrent caller hitting its own in-flight guard already observes it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/overlay-inbox #800 +/- ##
========================================================
- Coverage 65.95% 65.67% -0.29%
+ Complexity 1290 1286 -4
========================================================
Files 224 224
Lines 7676 7680 +4
Branches 1232 1233 +1
========================================================
- Hits 5063 5044 -19
- Misses 2218 2247 +29
+ Partials 395 389 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
Build available to test |
|
📏 SDK Binary Size Comparison Report
|
mahmoud-elmorabea
marked this pull request as ready for review
July 28, 2026 06:21
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.
Follow-up to the review of #769, addressing the Bugbot finding raised against the merged feature branch.
The problem
When a queue poll is already fetching templates and branding, a concurrent overlay
load()returns immediately on the repository's in-flight guard, before anything is cached. That produced a settledHiddensnapshot withloading = false, andInboxListContentrenders nothing at all forHidden— so the panel sat blank untilobserveContentChangesfired after the real fetch finished, instead of showing its spinner.The fix
load()reportsloadingwhen the inbox is not yet renderable AND a fetch is still running.isFetchInFlightis exposed onVisualInboxfor that check.This brings Android in line with iOS, which already behaves correctly for a different reason:
performRevalidationsets.loadingbefore fetching, so a concurrent caller hitting its own in-flight guard returns early and leaves.loadingin place.Tests
load_givenFetchInFlightAndNotYetRenderable_expectLoadingload_givenHiddenAndNoFetchInFlight_expectNotLoading— the control, so a genuinely non-renderable inbox cannot spin forever594 tests, 0 failures across
messaginginapp+messaginginbox; ktlint and apiCheck clean.Note
Low Risk
Localized overlay UI state logic with unit tests; no auth, data mutation, or network behavior changes.
Overview
Fixes a blank inbox panel when overlay
load()runs while a queue poll is already fetching templates/branding:loadTemplatesAndBranding()returns immediately on the repository in-flight guard, so the UI used to get Hidden withloading = falseand render nothing untilobserveContentChangesfired.VisualInboxnow exposesisFetchInFlight(from the repository).VisualInboxController.load()setsloading = truewhen the snapshot is not yet visible but a fetch is still running, so the panel shows its spinner instead of an empty state—aligned with iOS behavior.Unit tests cover the in-flight loading case and the control where a settled Hidden inbox must not spin forever.
Reviewed by Cursor Bugbot for commit 997e5a4. Bugbot is set up for automated code reviews on this repo. Configure here.