TASK22224: harden awaiting-submission blob retrieval contract
This commit is contained in:
@@ -293,3 +293,41 @@ Validation:
|
||||
Follow-ups:
|
||||
|
||||
- Optional: add the same stale-tag existence guard pattern to any remaining Azure tag-list readers that still consume `findBlobsByTags` results without property existence verification.
|
||||
|
||||
---
|
||||
|
||||
### CL-008: TASK22224 awaiting-submission route resilience parity hardening
|
||||
|
||||
date: 2026-03-23
|
||||
author: Cline
|
||||
scope: `pages/api/file/getawaitingsubmissionfromblob.js`, `tests/phase21/file-handler-contract.test.cjs`
|
||||
type: change
|
||||
rationale: Add explicit catch-path contract parity for awaiting-submission blob retrieval route so unexpected dependency failures return consistent, actionable error envelopes.
|
||||
impact: Improves reliability/diagnostics for post-delete case refresh and aligns file-route error handling style without changing success payload contract or hash verification behavior.
|
||||
status: completed
|
||||
|
||||
Summary:
|
||||
|
||||
- Refactored `getawaitingsubmissionfromblob` handler to structured `try/catch` flow.
|
||||
- Preserved existing guard behavior:
|
||||
- `MISSING_REQUIRED_QUERY` for missing container/hash
|
||||
- `INVALID_HASH` for signature mismatch
|
||||
- Added explicit dependency failure contract:
|
||||
- `GET_AWAITING_SUBMISSION_BLOB_FAILED` (400)
|
||||
- message: `Failed to retrieve awaiting submission blobs`
|
||||
- Added phase21 coverage for this route:
|
||||
- success payload pass-through contract
|
||||
- dependency failure contract assertion
|
||||
|
||||
Validation:
|
||||
|
||||
- `node tests/phase21/file-handler-contract.test.cjs` -> pass (27/27)
|
||||
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
|
||||
- helper: 4/4
|
||||
- file-handler: 27/27
|
||||
- email-handler: 12/12
|
||||
- endpoint-handler: 149/149
|
||||
|
||||
Follow-ups:
|
||||
|
||||
- Optional parity sweep: apply the same explicit catch-path contract pattern to remaining file routes that still rely on implicit promise-chain errors.
|
||||
|
||||
Reference in New Issue
Block a user