fix(web): route uninitialised-project refusals through the error screen - #334
Merged
Merged
Conversation
The systemic class, on the three paths a run actually proved. `console.error();
process.exit(1)` in a guard never throws, so the surrounding catch never runs,
so displayErrorAndExit never serves its page. rotateCommand documents this
class and its own fix; it was never applied elsewhere.
checkout throw into the catch that already routes correctly
decrypt same
branch not inside a try, so it calls displayErrorAndExit directly —
that function reads web mode itself, so no flag plumbing
Framed against the invariant: a URL reaches the caller. Nothing here asserts
loopback, so moving the renderer to Keep does not rewrite these tests.
TWO COMMANDS I NEARLY REPORTED AS BROKEN AND DID NOT, because the control
caught them:
kick `kick --web` never reaches a guard — Commander rejects it first
with `missing required argument 'email'`.
checkout `checkout --web` with no branch name does the same. The first
draft ran exactly that, saw output with no URL, and would have
filed a violation that does not exist. Passing `somebranch`
reaches the real guard, which was genuinely broken and is fixed
here.
Both failed on "did it reach its refusal", not on "was there a URL". A test
that asserts an absence without first proving the command arrived is a test
that invents defects, and this file would have invented two.
transport, edit and org are absent for the opposite reason: their runs get
past the guard into the auth path and do hand back a URL. A source sweep lists
them; running them clears them.
Observed, not inferred:
$ capy checkout somebranch --web
No keep.lock file found. Run capy first to initialize the project.
What went wrong is in your browser:
http://127.0.0.1:49657/s/...
Suite: 1847 pass, 0 fail.
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.
The systemic class, on the three paths a run actually proved.
console.error(); process.exit(1)in a guard never throws → the surrounding catch never runs →displayErrorAndExitnever serves its page.rotateCommand.tsdocuments this class and its own fix; it was never applied elsewhere.checkoutdecryptbranchdisplayErrorAndExitdirectly — that function reads web mode itself, so no flag plumbingFramed against the invariant — a URL reaches the caller. Nothing asserts loopback, so moving the renderer to Keep will not rewrite these tests.
Two commands I nearly reported as broken, and did not
The control caught both:
kick—kick --webnever reaches a guard; Commander rejects it first withmissing required argument 'email'.checkout—checkout --webwith no branch name does the same. The first draft of this file ran exactly that, saw output with no URL, and would have filed a violation that does not exist. Passingsomebranchreaches the real guard, which was genuinely broken and is fixed here.Both failed on "did it reach its refusal", not on "was there a URL". A test that asserts an absence without first proving the command arrived is a test that invents defects — this file would have invented two.
transport,editandorgare absent for the opposite reason: their runs get past the guard into the auth path and do hand back a URL. A source sweep lists them; running them clears them.Observed, not inferred
Suite: 1847 pass, 0 fail.