Summary
Mutation endpoints like alert registration and webhook registration should be idempotent when the same request is submitted twice. A shared helper that hashes the request body and returns a stable idempotency key allows duplicate detection without requiring clients to send an explicit key.
Scope
- Add
hashRequestBody(body: unknown): string helper using a stable hash function (e.g. SHA-256)
- Returns a hex string of fixed length
- Same input always produces the same output
- Add unit tests for: identical objects produce identical hashes, different objects produce different hashes, empty object has a stable hash
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Mutation endpoints like alert registration and webhook registration should be idempotent when the same request is submitted twice. A shared helper that hashes the request body and returns a stable idempotency key allows duplicate detection without requiring clients to send an explicit key.
Scope
hashRequestBody(body: unknown): stringhelper using a stable hash function (e.g. SHA-256)Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram