Repository navigation
fix(cli): a preview older than the checkpoint route is not adopted as the history owner - #6218
Open
miguel-heygen wants to merge 3 commits into
Open
miguel-heygen wants to merge 3 commits into
miguel-heygen wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 2 important · 0 nits · head b05c0665
- important —
historyOwner.ts:244: the gate sits inconnect(), so it also covershistory list/show/peek/undo/restore/pin/begin/end. Against a v0.8.151 preview that holds the history, those commands used to work, because every route they call exists in v0.8.151. Now they fail with the restart message, andwithReaderdoesn't fall back to its read-only view because the error is aRefusal, not aHistoryBusyError. Restarting the preview is a fair fix, but the PR body says "nothing else changes". Either say in the body that these commands now refuse, or limit the refusal tocheckpoint. - important — the non-required
Commentsratchet fails on this head:historyOwner.tscomment share 6.2% → 6.4% from the two added doc comments (:228,:231).
Scope
Confirmed /checkpoint first shipped in v0.8.152 (#5524 merge commit is in tags from v0.8.152 on), and the route set is unchanged from v0.8.152 to the current version, so one version gate covers every route the CLI calls. compare-versions is already a cli dependency. The new suite passes locally; on the base historyOwner.ts the first two cases fail and the third passes, matching the PR body. Required CI was still running at review time.
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 162 of thoseThe gate passes. Quarantined, measured but not gated (0) |
This branch has not been deployed
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 changes for you
With a preview from an older HyperFrames still running on the project,
check --jsonandsnapshotno longer lose their reports. If the CLI can use the project's history without that preview, it does. If the old preview holds the history, the command now says which preview is too old and how to restart it, instead ofCheck report was not recorded: The preview answered 404.Why
historyOwner.connect()adopted any running preview whoseGET /historywas not 404. Previews before v0.8.152 answer that route but have noPOST /history/checkpoint(first shipped in #5524, v0.8.152), so every report-recording call returned 404 and the report was dropped.How
connect()checks the preview's reported version againstFIRST_PREVIEW_WITH_CHECKPOINT = "0.8.152"before adopting it. A dev server, or any version that is not a release number, is taken as current, so nothing else changes. A too-old preview is passed over: the CLI opens the history itself. If the old preview holds the history lock, the CLI reports the preview's port and version and tells the user to restart it withhyperframes preview.Tests
New
historyOwner.connect.test.tswith a fake old preview:With the gate removed, the first two fail. 3 runs in a row green; the existing history, artifact-capture and check-artifact suites pass (66 tests with the new file). Lint, format and typecheck clean.
Not covered: a real v0.8.151 preview (I did not install one); the fake serves what it served on those routes.