Skip to content

fix(items): a keyed create claims its key before the plan-limit check (TASK-3585) - #2088

Merged
xarmian merged 1 commit into
mainfrom
rook/task-3585-create-limit
Oct 12, 2026
Merged

xarmian merged 1 commit into
mainfrom
rook/task-3585-create-limit

Conversation

@xarmian

@xarmian xarmian commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Retro CONVE-735 finding on #2065 (TASK-3585). handleCreateItem enforced the workspace item limit before claiming the idempotency key. A create that succeeded AT the limit and lost its answer could therefore not replay: its retry met the limit its own success had reached.

Fix

  • The key claim now comes first. Nothing modifies the request in between, so the key's hash is unchanged.
  • Every refusal after the claim, the limit included, still releases the key.

Tests

  • TestTASK3585_CreateAtTheLimitReplays: with the cap set to live + 1, the keyed create that reaches the cap replays on retry. The control: a NEW key at the cap is still refused. Red with the limit check moved back ahead of the claim.
  • Plan-limit and create suites are green locally. Full internal/server + internal/store + lint are still running locally; CI runs the same packages.

Codex: CLEAN at fedeb08 (gpt-6-luna).

https://claude.ai/code/session_01Q9WssCjFuHjSfLABoW4tmS

… (TASK-3585)

Retro CONVE-735 finding on #2065. handleCreateItem enforced the workspace
item limit before claiming the idempotency key, so a create that
succeeded AT the limit and lost its answer could not replay: its retry met
the limit its own success had reached. The claim now comes first; the
request is not modified in between, so the key's hash is unchanged, and
every refusal after it (the limit included) still releases the key.

Claude-Session: https://claude.ai/code/session_01Q9WssCjFuHjSfLABoW4tmS
@xarmian
xarmian merged commit 6dbe15e into main Oct 12, 2026
12 checks passed
@xarmian
xarmian deleted the rook/task-3585-create-limit branch October 12, 2026 00:34
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