Skip to content

docs: Add ADR 0044 - API standards for updating and deleting resources - #885

Closed
mike-gorman-bitwarden wants to merge 2 commits into
mainfrom
docs/adr-0044-api-standards-for-updating-and-deleting-resources
Closed

mike-gorman-bitwarden wants to merge 2 commits into
mainfrom
docs/adr-0044-api-standards-for-updating-and-deleting-resources

Conversation

@mike-gorman-bitwarden

@mike-gorman-bitwarden mike-gorman-bitwarden commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🎟️ Tracking

Follow-up to ADR-0036 (#865).

📔 Objective

Adds ADR-0044, "API standards for updating and deleting resources", with status Proposed. Sets how resources are updated and deleted: PUT with complete replacement, partial updates (discouraged; RFC 7396 semantics with a recorded departure on empty strings), optimistic concurrency with a version field and 409 (with the recorded departure from conditional requests), and hard and soft deletes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Deploying contributing-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: e15d912
Status: ✅  Deploy successful!
Preview URL: https://3cccee2a.contributing-docs.pages.dev
Branch Preview URL: https://docs-adr-0044-api-standards.contributing-docs.pages.dev

View logs

@rkac-bw

rkac-bw commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

From the database side:

  1. version: an integer that changes on every update matches what we would store (BIGINT, incremented in the same statement as the update). Supportive.
  2. Soft deletes need a purge horizon. A service that soft-deletes should state how long deleted rows are kept before a hard delete, and who runs the purge. Otherwise deleted data accumulates indefinitely, which is a storage cost and, for user data, a deletion-obligation question.
  3. Uniqueness under soft delete. Worth one line: a unique constraint must exclude soft-deleted rows (a filtered unique index), or a deleted resource blocks re-creating one with the same name or email.

@mike-gorman-bitwarden

Copy link
Copy Markdown
Contributor Author

Thanks.

  1. Good to hear.
  2. Agreed that a service with soft deletes needs a retention period and a purge, but that's that service's retention policy, not part of the API contract. Callers can always ask for permanent=true.
  3. How a service enforces uniqueness, and whether a soft-deleted resource blocks re-creating one, is up to the owning service. A filtered unique index is a good way to do it.

@mike-gorman-bitwarden
mike-gorman-bitwarden marked this pull request as ready for review October 14, 2026 09:10
@mike-gorman-bitwarden
mike-gorman-bitwarden requested a review from a team as a code owner October 14, 2026 09:10
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This reviews the new ADR-0044 (status Proposed), which sets standards for updating resources (PUT, plus PATCH for partial updates, which it discourages), for optimistic concurrency (a version field and 409), and for hard and soft deletes. The frontmatter, the AdrTable usage, and the section structure match ADR-0036 and the MADR template, and the claims made about RFC 9110 and RFC 7396 are accurate. One question is open: how a required version works with create-or-update PUT and with partial updates. ADR-0039, ADR-0040 and ADR-0045 are mentioned in plain text and are not on main yet, so they create no broken links.

Code Review Details
  • ❓ : How a required version and the 409-on-mismatch rule apply to a creating PUT and to PATCH
    • docs/architecture/adr/0044-api-standards-for-updating-and-deleting-resources.md:78-82

@mike-gorman-bitwarden

Copy link
Copy Markdown
Contributor Author

This PR is superseded by #894. We have done our best to retain/incorporate all feedback received to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants