Skip to content

Keep cached pages usable on slow or failing networks - #3893

Open
brsbl wants to merge 23 commits into
mainfrom
bb/improve-poor-network-page-resilience-thr_3mafhqizp2
Open

brsbl wants to merge 23 commits into
mainfrom
bb/improve-poor-network-page-resilience-thr_3mafhqizp2

Conversation

@brsbl

@brsbl brsbl commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Human comments

  • the goal is to allow users to keep using bb in a read-only way when they have slow/spotty network. today, bb can get pretty unusable in these scenarios (eg driving in a short tunnel)
  • this PR caches loaded pages while fetching new data in the background, and only invalidates the cache if the request succeeds.

What was wrong

Blocking config reads and error-first rendering hid cached data on slow or failing networks. Thread caches expired after five minutes, and failed page-code downloads escaped to the app-wide error screen.

What changed

  • Cached config, sidebar, project, plugin, skill and automation content remains visible through background refreshes; successful responses update it.
  • Returning threads display cached messages for up to 30 minutes of inactivity while newer data loads.
  • Failed page-code downloads show a page error with Reload page, keeping app navigation usable.

Uses existing query caches, subscriptions and error boundaries. Mutations and public APIs are unchanged. Thread caching is in memory; hard reloads need the network. Page-download recovery requires the app shell to have loaded.

How you verified

  • Remote CI passed at 94d252b6b: cached reads, refresh success/failure, cache misses, retention and page-error recovery.
  • Chrome for Testing 153.0.8010.52, 390 × 844 @2×: delayed reads, injected 503s and recovery passed across changed surfaces.
  • Fresh five-panel Slop Cop found no P0/P1 issues; two P2 follow-ups are recorded below.

States screenshots cannot establish alone

State over time Before After Verification
Stale config: pending → success or failure Blocked on the read. Return cached config immediately; apply successful updates through existing subscriptions. Remote pending/success/failure regressions passed.
Persisted sidebar: failed refresh → retry Placeholder content could disappear. Keep the snapshot until a successful response replaces it. Remote replay, failure/retry and invalidation regressions passed; browser reload/recovery passed.
Thread return after five minutes Cache eviction caused a loading skeleton. Render cached messages during refresh; keep them after failure. After 5m 9s away: 34 rows visible in 176 ms with ten reads held; all survived 503, then refreshed successfully.
Cached project/plugin/skill/automation: failure → success Failed reads hid or cleared content. Keep the last successful content until refresh succeeds. Remote regressions and browser 1.2–1.6s delays/503/recovery passed; skill and automation updates appeared.
Page-code failure: navigate away → return → reload App-wide error removed navigation and persisted after connectivity returned. Keep navigation usable; reload recovers the failed page. Actual Settings module 503: Back to app opened the composer; return stayed contained; reload restored General settings.
Before / after screenshots

Merge base 7bbff00 → PR head 94d252b; matching fixtures, routes, interaction states and 390 × 844 @2×. Thread screenshots show requests held after five minutes away; the page-code pair shows a Settings module 503; other pairs show failed background reads. Registry content uses a deterministic fixture. Fresh captures use Chrome for Testing 153.0.8010.52; retained base captures for thread, plugin settings, defaults and both skill views use 153.0.8010.36.

Surface Before After
Failed page-code download Before: Failed page-code download After: Failed page-code download
Thread return with requests held Before: Thread return with requests held After: Thread return with requests held
Projects Before: Projects After: Projects
Project details Before: Project details After: Project details
Installed plugins Before: Installed plugins After: Installed plugins
Plugin details Before: Plugin details After: Plugin details
Plugin settings Before: Plugin settings After: Plugin settings
Project thread defaults Before: Project thread defaults After: Project thread defaults
Registry skill source Before: Registry skill source After: Registry skill source
Local skill file Before: Local skill file After: Local skill file
Automation detail Before: Automation detail After: Automation detail
P2 follow-ups

The fresh review covered all 23 changed files at 94d252b6b against 7bbff004b. These P2s are deferred under the requested review policy:

  • Partial sidebar replay: after bootstrap failure, the 30-thread persisted snapshot can suppress child/mention fallback reads. Distinguish partial replay from complete bootstrap data.
  • Sidebar freshness: realtime patches can mark an unrefreshed snapshot indefinitely fresh. Preserve staleness until a complete bootstrap succeeds.

BB-Thread-ID: thr_3mafhqizp2

AGENT GENERATED

@brsbl brsbl changed the title Keep cached pages and thread history visible during refreshes Show cached pages and thread history while refreshing Sep 19, 2026
@brsbl brsbl changed the title Show cached pages and thread history while refreshing Keep cached page content visible during background refresh Sep 19, 2026
@brsbl brsbl changed the title Keep cached page content visible during background refresh Keep cached pages visible during slow or failed refreshes Sep 19, 2026
@brsbl
brsbl marked this pull request as ready for review September 19, 2026 21:08
@brsbl brsbl changed the title Keep cached pages visible during slow or failed refreshes Keep cached pages visible and contain download failures Sep 19, 2026
@brsbl brsbl changed the title Keep cached pages visible and contain download failures Keep cached pages usable on slow or failing networks Sep 19, 2026
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