Repository navigation
Harden pane hydration + poll daemon readiness until healthy (relates #1672) - #1677
Merged
mstomar125 merged 1 commit intoJul 16, 2026
Merged
Conversation
…1672) A pane's hydration fetch runs once per tab change; when the first fetch races the daemon's boot window (fresh install: the webview renders while the sidecar is still seeding its DB and binding the socket) the invoke rejects with a transport error, hydrateNode swallows it, and the pane sits on "Loading..." forever — the sidebar populates because every other daemon-dependent load already retries on the healthy transition. Register the same onDaemonReconnect retry idiom in pane-content: on a not-healthy → healthy transition, re-run hydrateNode for the active tab's node if it is still absent from the store. The store-presence guard keeps it a no-op after successful hydration. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
Author
|
REQUEST CHANGES (adversarial review of The 19-line retry is legitimate hardening of a real terminal-failure path and is correctly built (registration order, initial-fire semantics, cleanup, multi-pane behavior all check out). But:
Fix direction: persistent daemon-status polling so the reconnect signal is reliable for every consumer; retitle to hardening with "Relates #1672"; pin the actual wiring in tests; distinct retry logs. #1672 stays open pending the live fresh-install leg. |
Contributor
Author
|
Addressed the review; merging as hardening with #1672 kept open for the live fresh-install validation leg (round-2):
|
This was referenced Jul 16, 2026
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.
What this is
Hardening of the pane-hydration path plus a persistent daemon-readiness poll. It relates to #1672 (the fresh-install "Daily Journal Loading… forever" P0) and is the most likely fix, but the root cause is not yet confirmed on a live device, so #1672 stays open until the fresh-install validation leg runs (round-2, on the validation Mac). Do not auto-close #1672 on this merge.
Why it's framed as hardening, not a confirmed fix
The round-1 report notes "reload does not fix it" and "no WatchNodes activity" across the hung session — both consistent with a failure at or below the app→daemon transport (e.g. a wedged lazy gRPC channel) rather than a swallowed one-shot fetch alone. A frontend re-invoke can only heal the latter. This PR fixes a real terminal-failure path (a hydration fetch that fails during the daemon boot window is never retried) and closes the signal hole that would defeat that retry — but confirming it resolves the user-visible hang needs a live fresh-install run, which can't be done headlessly.
Changes
pane-content.svelte: retry the active tab's hydration when the daemon becomes healthy (guarded by store-presence; not-found→close-tab semantics unchanged).daemon-status.ts: pollcheck_daemon_statusuntil the daemon is first observed healthy, then stop and let the push channel carry later transitions. Previously the "healthy" signal came only from the backend's one-shot readiness emit (bounded by a fixed timeout) — a slower fresh-install boot would emit a single non-healthy status and never emit healthy, soonDaemonReconnect(this retry, and the sidebar stores) would wait forever. This makes the signal reliable for every consumer.Tests
daemon-status.test.ts(+2): a boot where the push never carries healthy but a later poll observes it still firesonDaemonReconnect; the poll stops once healthy (no further pulls).pane-content-hydration.test.ts(+1): a hydration that fails then succeeds on the reconnect retry.Addresses the review
🤖 Generated with Claude Code