Skip to content

fix(inbox): show the spinner while a concurrent fetch is still running - #800

Merged
mahmoud-elmorabea merged 1 commit into
feat/overlay-inboxfrom
inbox-review-followups
Jul 28, 2026
Merged

fix(inbox): show the spinner while a concurrent fetch is still running#800
mahmoud-elmorabea merged 1 commit into
feat/overlay-inboxfrom
inbox-review-followups

Conversation

@mahmoud-elmorabea

@mahmoud-elmorabea mahmoud-elmorabea commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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 settled Hidden snapshot with loading = false, and InboxListContent renders nothing at all for Hidden — so the panel sat blank until observeContentChanges fired after the real fetch finished, instead of showing its spinner.

The fix

load() reports loading when the inbox is not yet renderable AND a fetch is still running. isFetchInFlight is exposed on VisualInbox for that check.

This brings Android in line with iOS, which already behaves correctly for a different reason: performRevalidation sets .loading before fetching, so a concurrent caller hitting its own in-flight guard returns early and leaves .loading in place.

Tests

  • load_givenFetchInFlightAndNotYetRenderable_expectLoading
  • load_givenHiddenAndNoFetchInFlight_expectNotLoading — the control, so a genuinely non-renderable inbox cannot spin forever

594 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 with loading = false and render nothing until observeContentChanges fired.

VisualInbox now exposes isFetchInFlight (from the repository). VisualInboxController.load() sets loading = true when 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.

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>
@mahmoud-elmorabea mahmoud-elmorabea self-assigned this Jul 28, 2026
@github-actions

Copy link
Copy Markdown

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

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 65.67%. Comparing base (84d2989) to head (997e5a4).
⚠️ Report is 1 commits behind head on feat/overlay-inbox.

Files with missing lines Patch % Lines
...va/io/customer/messaginginapp/inbox/VisualInbox.kt 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
  • java_layout: inbox-review-followups (1785218927)

@github-actions

Copy link
Copy Markdown

Build available to test
Version: inbox-review-followups-SNAPSHOT
Repository: https://central.sonatype.com/repository/maven-snapshots/

@github-actions

Copy link
Copy Markdown
  • kotlin_compose: inbox-review-followups (1785218922)

@github-actions

Copy link
Copy Markdown

📏 SDK Binary Size Comparison Report

Module Last Recorded Size Current Size Change in Size
core 45.65 KB 45.65 KB ✅ No Change
datapipelines 42.63 KB 42.63 KB ✅ No Change
messagingpush 31.45 KB 31.45 KB ✅ No Change
messaginginapp 148.17 KB 148.17 KB ✅ No Change
messaginginbox 60.40 KB 60.46 KB ⬆️ +0.06KB
tracking-migration 22.89 KB 22.89 KB ✅ No Change
location 18.93 KB 18.93 KB ✅ No Change
geofence 78.55 KB 78.55 KB ✅ No Change

@mahmoud-elmorabea
mahmoud-elmorabea marked this pull request as ready for review July 28, 2026 06:21
@mahmoud-elmorabea
mahmoud-elmorabea requested a review from a team as a code owner July 28, 2026 06:21
@mahmoud-elmorabea
mahmoud-elmorabea merged commit 11ed9b7 into feat/overlay-inbox Jul 28, 2026
47 checks passed
@mahmoud-elmorabea
mahmoud-elmorabea deleted the inbox-review-followups branch July 28, 2026 06:21
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