Skip to content

fix(dashboard): suppress false-pending sync overlay, detect and recover false-live wedge - #329

Merged
sethvoltz merged 3 commits into
mainfrom
friday/builder-fri-180
Jul 16, 2026
Merged

fix(dashboard): suppress false-pending sync overlay, detect and recover false-live wedge#329
sethvoltz merged 3 commits into
mainfrom
friday/builder-fri-180

Conversation

@sethvoltz

Copy link
Copy Markdown
Owner

Summary

  • Bug 1 (false-pending overlay): ZeroSyncStore now seeds #hydratedBefore synchronously at construction from localStorage (Phase 1: !== null), then corrects it async after clientGroupID resolves (Phase 2: === cgid). SyncOverlay skips the 500ms pending→show timer when hydratedBefore is true, so a warm PWA relaunch paints from the IndexedDB cache without the overlay flashing. Schema bumps produce a brief flash (new cgid ≠ stored cgid) — expected and acceptable.

  • Bug 2 (false-live wedge): All 17 view.addListener callbacks now stamp #lastInboundAt; the connected state transition also stamps it. A 60s heartbeat keeps it fresh when Zero is live and idle (preventing false-stale on healthy idle sessions). get dataStalled (> 120s since last activity) signals a wedge. The connectivity watchdog (5s tick) triggers handleFalseLiveRecovery (destroy + re-init, capped at 3 attempts per session) and resolveWidget maps the stalled state to reconnecting. #blocksListeners.clear() removed from destroy() so the module-level onBlocksUpdate registration survives reconnects.

Notes

  • Manual device verification required: Both the warm-launch overlay suppression and the false-live wedge recovery are triggered by PWA backgrounding / TCP keepalive scenarios that cannot be exercised in unit tests. Verification requires deploying to a device, locking the screen for 3+ minutes, relaunching, and observing (a) no overlay flash on warm launch and (b) the connectivity widget recovering from the wedge state without a manual reload.
  • The one pre-existing svelte-check warning (PalettePreview.svelte state reference) is unrelated to this change.

Closes FRI-180

sethvoltz and others added 3 commits July 6, 2026 17:25
…er false-live wedge

FRI-180 — two PWA sync reliability fixes:

Bug 1 (false-pending overlay): ZeroSyncStore now seeds #hydratedBefore
synchronously from localStorage at construction (Phase 1), then corrects
it async after clientGroupID resolves (Phase 2 — handles schema bumps).
SyncOverlay skips the 500ms pending→show timer when hydratedBefore is
true so a warm PWA relaunch paints from the IndexedDB cache without the
overlay flashing.

Bug 2 (false-live wedge): view.addListener callbacks now stamp
#lastInboundAt on every inbound data frame; the connected state
transition also stamps it. A 60s heartbeat keeps it fresh when Zero is
live and idle. dataStalled (>120s since last activity) signals a wedge.
The connectivity watchdog triggers handleFalseLiveRecovery (destroy +
re-init, capped at 3 attempts) and resolveWidget maps the stalled state
to 'reconnecting'. #blocksListeners is no longer cleared in destroy() so
the module-level onBlocksUpdate registration survives reconnects.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ocs/mobile-ux.md

- handleFalseLiveRecovery: wrap in try/finally so #falseLiveHandling is
  always reset even if #init() throws; #init() now returns Promise<boolean>
  so the attempt counter only resets on a completed (non-aborted) init run

- docs/mobile-ux.md: add PWA sync reliability section (FRI-180) covering
  warm-launch overlay suppression and false-live wedge detection/recovery

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sethvoltz
sethvoltz merged commit a50773d into main Jul 16, 2026
6 checks passed
@sethvoltz
sethvoltz deleted the friday/builder-fri-180 branch July 16, 2026 22:29
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