Flag Subscribe and EnableCardColumnOnHold as naturally idempotent

Merged
JE
4mo ago
+93-38

Why

#480: Subscribe and EnableCardColumnOnHold are set-membership POSTs — subscribing an already-subscribed user and enabling an already-enabled on-hold section are server-side no-ops — so a retried request cannot duplicate anything. They carry the same contract as the already-flagged CompleteTodo/PauseQuestion/SubscribeToCardColumn but were never flagged, leaving them un-retried in every SDK for no reason.

What

  • @basecampIdempotent(natural: true) on both operations in the Smithy spec; full make generate flows it through behavior-model.json (idempotent: true), all five metadata emitters, and Go's doWithRetry call-site booleans.
  • maxAttempts stays 2 — whether these belong at 3 is #479's question, deliberately untouched.
  • Parity gate source-of-truth counts: 69→71 idempotent, 186→188 idempotent∪readonly.
  • SPEC.md (ceiling narrative, Swift divergence note, Appendix E) and SECURITY.md follow the counts; the sweep also surfaced and fixes two pre-existing off-by-ones (183→182 ops at max 3, 187→186-now-188 retry-eligible).
  • New conformance case: Subscribe mocked [503, 200] must make 2 requests — mirrors the CompleteTodo case; dispatch branches in the Go/TS/Python/Kotlin runners, Ruby skip-list entry (GET-only retry).

Verification

Full make green locally (exit 0). Conformance: Go/Kotlin/Python print PASS: Subscribe POST retries when marked idempotent, Ruby SKIP (Ruby SDK only retries GET), TS suite 118 passed (unknown-op dispatch throws there, so the case demonstrably ran).

Behavior change: these two POSTs now retry on 429/503 (and network errors in Go/Python/Swift) — bundled ahead of v0.11.0 so the release carries all retry-contract changes at once.

Closes #480.


Summary by cubic

Marks Subscribe and EnableCardColumnOnHold as naturally idempotent so SDKs safely retry these POSTs on transient errors. Aligns behavior with existing idempotent POSTs and closes #480.

  • New Features
    • These POSTs now retry on 429/503 (and network errors where supported: Go/Python/Swift).
    • Added @basecampIdempotent(natural: true) in the Smithy spec; regeneration updates all SDK metadata and Go doWithRetry call sites.
    • New conformance test for Subscribe with mocked [503, 200]; runners updated (Ruby skipped due to GET-only retries).
    • Docs and parity counts updated: 71 idempotent ops, 188 retry-eligible; fixed two prior count drifts. maxAttempts stays 2 (see #479 for any change).