Repository navigation
Idempotency key for ticket notes - #1945
Merged
neuromechanist merged 4 commits intoOct 24, 2026
Merged
neuromechanist merged 4 commits into
neuromechanist merged 4 commits into
Conversation
Optional Idempotency-Key on the note route, stored in mail_note_keys (migration 0108), purged with the ticket. Tested with real D1. ADR 0112 updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The CLI always sends an Idempotency-Key on a note (generated or --idempotency-key), prints it first, and advises a retry with it after a network failure or 5xx. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A keyed note's ticket bump and event run only when the preceding statement changed a row. A missing stored key after the batch is a 500. Tests: race, late purge, cascade. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CLI note retries with its key on 408 and 429 (replies unchanged); help documents intent-not-text and JSON Lines stderr; ADR 0112 sentence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR1945Version: 🤖 Updated on each push. |
neuromechanist
merged commit Oct 24, 2026
75a26cf
into
feature/issue-1893-epic-email-cf
13 of 14 checks passed
This was referenced Oct 24, 2026
Merged
This branch was previously 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.
Summary
POST /admin/mail/tickets/:id/noteaccepts an optionalIdempotency-Key(same format as replies, unique per ticket), so a note retried after a lost response is stored once. Notes send no mail, so there is no pending or unknown state: the note and its key are written in one batch, and a repeat of the key returns the storedmessage_idand writes nothing. Note keys live in their own table (migration 0108), so a note key and a reply key never collide. The retention purge deletes note keys with the rest of a ticket.nemar admin mail notealways sends a key, prints it before sending, and after a network failure or a 5xx says to retry with it.Closes #1941
Part of epic #1893.
Test plan
🤖 Generated with Claude Code