fix(dashboard): suppress false-pending sync overlay, detect and recover false-live wedge - #329
Merged
Conversation
…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>
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.
Summary
Bug 1 (false-pending overlay):
ZeroSyncStorenow seeds#hydratedBeforesynchronously at construction fromlocalStorage(Phase 1:!== null), then corrects it async afterclientGroupIDresolves (Phase 2:=== cgid).SyncOverlayskips the 500mspending→showtimer whenhydratedBeforeis 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.addListenercallbacks now stamp#lastInboundAt; theconnectedstate 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(> 120ssince last activity) signals a wedge. The connectivity watchdog (5s tick) triggershandleFalseLiveRecovery(destroy + re-init, capped at 3 attempts per session) andresolveWidgetmaps the stalled state toreconnecting.#blocksListeners.clear()removed fromdestroy()so the module-levelonBlocksUpdateregistration survives reconnects.Notes
PalettePreview.sveltestate reference) is unrelated to this change.Closes FRI-180