Repository navigation
feat(operations): Expose idempotent flag in the operation catalog - #111
Merged
Merged
Conversation
Read Sentry's x-sentry-idempotent operation extension so retrying clients can tell which operations are safe to resend after a timeout or 5xx, instead of hard-coding it per call site. Refs getsentry/sentry#128927 Co-Authored-By: BYK <burak.kaya@sentry.io>
sentry-junior
Bot
requested review from
BYK,
MathurAditya724 and
betegon
as code owners
October 27, 2026 22:32
BYK
approved these changes
Oct 27, 2026
2 tasks done
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.
Adds
idempotent: booleanto everyApiOperationin@sentry/api/operations. Retrying clients such as the CLI and MCP can then decide from the catalog whether to resend a request after a timeout or 5xx, instead of hard-coding that per call site.Refs getsentry/sentry#128927. The Sentry side, getsentry/sentry#128930, now stamps
x-sentry-idempotent: trueon operations whose endpoint declares the method inidempotent_methods.Semantics
GET,HEAD,OPTIONS,TRACE: alwaystrue(RFC 9110 §9.2.1). Clients get one field to check, with no method special-casing.trueonly when the operation hasx-sentry-idempotent: true.PUTandDELETEare not assumed idempotent because not every Sentry handler follows RFC 9110 §9.2.2. Sentry makes the same choice.falsemeans "not known to be idempotent", not "known to be unsafe". It is documented that way in the type docs and the README.Current effect
Today's
openapi-derefed.jsonhas nox-sentry-idempotentmarkers. The endpoints declared so far (chunk upload, DIF assemble, artifact bundle assemble) are allPRIVATE, so nothing non-safe is marked yet. In the current build, 147 of 266 operations areidempotent: true, all safe methods. Non-safe operations will be marked as they're published with the declaration.Verification
bun run build,bun run typecheck,bun test(167 pass),bun run test:nodePOSTistrue; an unmarkedPOST/PUT/DELETEisfalse. Existing catalog fixtures asserttrueforGETandfalsefor an unmarkedPOST.via BYK.
--
View Junior Session in Sentry