fix(web): survive page reload without losing analysis or running LLM jobs - #18
Open
jakob1379 wants to merge 1 commit into
Open
fix(web): survive page reload without losing analysis or running LLM jobs#18jakob1379 wants to merge 1 commit into
jakob1379 wants to merge 1 commit into
Conversation
…jobs The web UI kept repo, branch pair, analysis, and job ids only in React state, so a reload dropped everything while the server kept the jobs running. Persist the session and the active job list in sessionStorage (web only, per tab), re-run the analysis on load, and re-attach to stored job streams after probing that the server still knows them. A job is forgotten only on a terminal event; Chromium fires the EventSource error during page teardown, so cleaning up on error wiped the list before the new page loaded. Jobs are scoped to the repo they were started for, each stream closes only the EventSource it owns, and a stored session is ignored when the server's --repo changed. Refinement results read the current analysis through a ref instead of a stale closure, which also fixes cached refinements being dropped on the first analysis of a page; a live result wins over a cached one.
Owner
|
Should we store the refinment streaming in SQLite, then we could use:
Thoughts on the above? |
Contributor
Author
|
SQLite would make sense. I'll get to it soon enough |
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.
Problem
In the web UI (
diffcore-web), a browser reload dropped everything: repo path, branch pair, analysis, and any LLM refinement / deep-analysis job that was still running. The server kept running the jobs and retained their SSE history, but the UI held all of that state only in React memory and never reconnected.Fix (web only, desktop opts out)
sessionStorage(per tab): repo path, base/head, the server's--repoit was recorded under, the repo the current analysis was run for, and whether the branch pair was picked explicitly.--repochanged, when the field holds an unsubmitted PR URL, or when the record is malformed.git checkoutmade in a terminal (the web UI has no HEAD watcher).errorwas wrong: Chromium fires theEventSourceerror during page teardown, which wiped the list before the new page loaded.EventSourceit owns.Preview
Verification
session-restore.spec.tscovers repo field + picked branches surviving reload, auto-detect resuming after changing the repo, and auto-detected branches being re-detected after reload.diffcore-webon this repo with real Claude CLI refinements (the demo-mode e2e suite has no server, so job reattach is manually verified only):--repo: field resets to the server's repo; unchanged: analysis restored without a click