π Description
DELETE /api/v1/anchors/:id deactivates an anchor per the README, but the response for deactivating an already-inactive anchor isn't documented or (as far as can be told) explicitly tested β is a second call a no-op 200, or does it error? DELETE-style operations are conventionally expected to be idempotent, and callers (including the frontend's confirm-dialog-guarded deactivate action) need a defined contract.
π§© Requirements and context
- Add a test asserting the actual current behavior of calling
DELETE /api/v1/anchors/:id twice in a row.
- If the current behavior isn't idempotent (e.g. errors on the second call), evaluate whether to make it idempotent (
200/no-op) for consistency with REST conventions β implement whichever is decided and document it.
- Document the decided contract in the README next to the endpoint description.
π οΈ Suggested execution
- Add the double-call test to
src/routes/anchors.test.ts.
- If a behavior change is warranted, update
AnchorService/AnchorRepository accordingly.
- Update the README's Anchors section with the explicit contract.
β
Acceptance criteria
π Security notes
No new attack surface; clarifies an operation already gated by an existing auth/validation path.
π Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
π Description
DELETE /api/v1/anchors/:iddeactivates an anchor per the README, but the response for deactivating an already-inactive anchor isn't documented or (as far as can be told) explicitly tested β is a second call a no-op200, or does it error? DELETE-style operations are conventionally expected to be idempotent, and callers (including the frontend's confirm-dialog-guarded deactivate action) need a defined contract.π§© Requirements and context
DELETE /api/v1/anchors/:idtwice in a row.200/no-op) for consistency with REST conventions β implement whichever is decided and document it.π οΈ Suggested execution
src/routes/anchors.test.ts.AnchorService/AnchorRepositoryaccordingly.β Acceptance criteria
π Security notes
No new attack surface; clarifies an operation already gated by an existing auth/validation path.
π Guidelines