TASK22102: slice6 blob crud and retrieval contract cleanup

This commit is contained in:
2026-03-17 13:23:01 +00:00
parent 3048df3cd9
commit 98184b65df
8 changed files with 145 additions and 52 deletions
+36
View File
@@ -1472,3 +1472,39 @@ Validation:
Follow-ups:
- Continue next larger slice on remaining file handlers with empty 400 responses to complete contract-consistency rollout.
---
### CL-040: TASK22102 API contract consistency — Slice 6 (CRUD/blob retrieval group)
date: 2026-03-17
author: Cline
scope: `pages/api/file/{deleteblob,deleteblobcase,deleteblobrep,deleteawaitingsubmissionfromblob,getprogressobjblob,getawaitingsubmissionfromblob,getrepsblob}.js`
type: change
rationale: Deliver the first of two remaining larger slices by standardizing response contracts across blob CRUD and retrieval handlers still using direct/empty response patterns.
impact: Improves consistency and safety of error responses in selected blob handlers while preserving existing success payload behavior and cache-control semantics.
status: completed
Summary:
- Migrated 7 blob CRUD/retrieval handlers to `respondSuccess`/`respondError`:
- `deleteblob`
- `deleteblobcase`
- `deleteblobrep`
- `deleteawaitingsubmissionfromblob`
- `getprogressobjblob`
- `getawaitingsubmissionfromblob`
- `getrepsblob`
- Replaced empty `400` and direct status responses with structured error envelopes including explicit codes/messages.
- Removed redundant post-hash equality branches where equivalent logic was already guaranteed after early guard checks.
- Preserved response behavior:
- existing success data payload shapes retained (`{ data: ... }` or direct data payloads)
- `getrepsblob` retains `Cache-Control: no-store` header.
Validation:
- `npx next lint --file pages/api/file/deleteblob.js --file pages/api/file/deleteblobcase.js --file pages/api/file/deleteblobrep.js --file pages/api/file/deleteawaitingsubmissionfromblob.js --file pages/api/file/getprogressobjblob.js --file pages/api/file/getawaitingsubmissionfromblob.js --file pages/api/file/getrepsblob.js` -> pass (no warnings/errors)
Follow-ups:
- Execute final Slice 7 for remaining complex handlers (`upload`, `getbloblist`, `downloadblob`, `generateappealpdf`) to complete the 2-slice finish plan.