Skip to content

test(e2e): address Alex's review feedback on the PKCE and desk-clash specs - #484

Merged
camreeves merged 2 commits into
developfrom
fix/e2e-477-review-followup
Aug 5, 2026
Merged

test(e2e): address Alex's review feedback on the PKCE and desk-clash specs#484
camreeves merged 2 commits into
developfrom
fix/e2e-477-review-followup

Conversation

@camreeves

Copy link
Copy Markdown
Contributor

Follow-up to #477. Alex's review arrived after that PR was merged, so these are separate commits rather than changes to it. All three points were valid.

1. Bind the PKCE challenge to the verifier (P1)

The spec checked that a code_challenge and a code_verifier were each present, but never that they were related. That passes even if the client stops deriving the challenge from the verifier — precisely the regression the test exists to catch.

It now asserts SHA-256(verifier) in base64url equals the challenge, and that the challenge is 43 base64url characters (32 bytes unpadded), so a code_challenge_method=S256 parameter that lies about the value gets caught.

Worth noting: the verifier is sent in the token request's query string, not the body — reading it from postData returns nothing.

2. Require 409, not >= 400 (P1)

Exactly as Alex said. A 500 satisfied the old assertion while proving nothing about clash detection, and booking POSTs have a documented way of returning 500 under concurrency (REG-09 / PPT-2642). Both clash assertions are now toBe(409), with the received status in the failure message.

3. Clean up the second user's bookings (P2)

GET /bookings is caller-scoped, so a booking the second user unexpectedly succeeds in creating is invisible to the owner's releaseAsset — the desk would stay held for every later run. Anything that user creates is now recorded and deleted as that user, before their request context is disposed.

Verification

  • Full suite green locally: 14 passed.
  • Both new assertions red-checked: hashing the wrong value fails the binding assertion, and the "verifier was sent" check caught the postData-vs-query-string mistake above rather than passing vacuously.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
frontend-templates Ignored Ignored Preview Aug 5, 2026 4:35pm

Alex's review on #477 landed after that PR was merged, so these are
follow-ups rather than changes to it.

- pkce: assert the challenge is actually SHA-256(verifier) in base64url,
  and that it is 43 base64url characters. Previously the spec only
  checked that a challenge and a verifier were each present, which would
  pass even if the two were unrelated — the exact state a client that
  stopped deriving the challenge correctly would leave things in.
  The verifier is read from the token request's query string, which is
  where ts-client puts it.

- desk-clash: require 409 rather than any >= 400. A 500 from an
  unhealthy backend satisfied the old check while proving nothing about
  clash detection, and booking POSTs have a known way of returning 500
  under load (REG-09).

- desk-clash: delete anything the second user unexpectedly succeeds in
  creating, as that user, before their context is disposed. GET
  /bookings is caller-scoped, so the owner's releaseAsset cannot see
  those rows and the desk would stay held for later runs.

Full suite green locally: 14 passed. Both new assertions red-checked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@camreeves
camreeves force-pushed the fix/e2e-477-review-followup branch from f7bda30 to 7aa3a71 Compare August 5, 2026 17:41
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/placeos?upgradeToPro=build-rate-limit

…is destroyed

`ngOnInit` scheduled a bare 100ms `setTimeout` that reads localStorage
and writes to the component's signals. Nothing cancelled it, so leaving
the page inside that window ran the callback against a component that no
longer exists.

In CI it fails the whole workplace test run: the timer outlives the test
environment and raises `ReferenceError: localStorage is not defined` as
an unhandled error, which vitest counts as a failure even though all 428
tests pass. It only shows on the slower runner, which is why it reads as
flaky.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@camreeves
camreeves merged commit 18e6701 into develop Aug 5, 2026
9 of 10 checks passed
@camreeves
camreeves deleted the fix/e2e-477-review-followup branch August 5, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant