Repository navigation
fix: lock evidence, review, and repository writes; give GitHub refreshes time - #21
Conversation
…hes time - Evidence link/refresh/unlink, review decisions, and repository connect/disconnect now lock the project's team and re-check membership and archived state before saving, like requirement writes. GitHub is read before the lock is taken, so a slow GitHub never stalls the team's other writes. - A refresh that races an unlink answers 409 instead of an unhandled 500, and saves nothing. - Links are counted again under the lock, so two links at once cannot pass the 50-link limit. - apiFetch accepts a per-call timeoutMs. Linking and refreshing get 55 seconds instead of 10, and the requirement page sets maxDuration = 60. - Docs: repository writes are team Owner/Admin, remove the retired add-member paragraph, a stray code fence, and stale ownership notes, and stop calling the GitHub App integration pending. ADR-048 records the decision.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Problem
A full review of
mainfound no failing checks, but five untested problems:apiFetch), while a refresh makes several GitHub calls per linked item and one per release/change pair. Around 20 or more linked pull requests shows "The evidence could not be refreshed."SaveChangesAsyncthrowDbUpdateConcurrencyException.docs/API.md,docs/ARCHITECTURE.md).Solution
RequirementEndpoints.LockForMember(now internal) andProjectEndpoints.LockProjectForCaller. Link, refresh, and connect read GitHub before taking the lock, so a slow GitHub never stalls the team's other writes. They then lock, check again (still a member, nothing archived, same repository connected), and save.409"The evidence changed while it was being read from GitHub. Reload and try again." and saves nothing. The web action already shows a 409's detail.DbUpdateConcurrencyExceptionis caught beforeDbUpdateException, so a removed release is no longer misreported as "already linked".apiFetchaccepts an optional per-calltimeoutMs. Linking and refreshing use 55 seconds, and the requirement page setsmaxDuration = 60so Vercel lets its server actions run that long. Every other call keeps the 10-second limit and the GET retry.API.md: repository writes are team Owner/Admin; the retired add-member paragraph is removed; a stray code fence that rendered the rest of the file as code is removed; a stale ownership note is removed; the new 409 is documented.ARCHITECTURE.md: the GitHub App integration is no longer called pending, and a second stale ownership note is removed.Validation
tests/schema/evidence.spec.ts: link/refresh/unlink wait for the team lock and return 409 once the project is archived; a refresh racing an unlink returns 409 (not 500) and saves nothing; two concurrent links at 49 give one 201 and one 409, and the requirement holds 50.tests/schema/reviews.spec.ts: a decision waits for the lock and is refused if the project was archived or the requirement edited meanwhile.tests/schema/github-repository.spec.ts: connect and disconnect wait for the lock and refuse an archived project.tests/e2e/evidence.spec.ts: a refresh delayed past 10 seconds by the test API proxy now completes (before:TimeoutError).tests/support/team-lock.tsholds a team's row lock from the test database, the way a concurrent write would.CI=1 npm test: 347 passed (341 existing plus 6 new).npm run lint,npm run typecheck,npm run build:api,dotnet format app/api --verify-no-changes --no-restore,dotnet ef migrations has-pending-model-changes(no changes),git diff --check.Screenshots
None. No visual change.
Migrations and environment
None. There is no schema change and no new environment variable.
Known limitations
maxDuration = 60has not been verified on Vercel. After merging, refresh a requirement with many links on spec-thread.com to confirm.Generated by Claude Code