TASK22224: harden getrepsblob against stale tag entries

This commit is contained in:
2026-03-23 17:37:03 +00:00
parent 8e0131d1ce
commit f484f87694
3 changed files with 109 additions and 5 deletions
+37
View File
@@ -256,3 +256,40 @@ Validation:
Follow-ups:
- Optional next slice: apply same bounded hash-canonicalization parity to remaining high-sensitivity file routes where mixed encoded/raw callers may exist (`getbloblist`, `getprogressobjblob`) and add regression cases to phase21.
---
### CL-007: TASK22224 getrepsblob stability hotfix after delete representation flow
date: 2026-03-23
author: Cline
scope: `actions/azurestorage.js` (`getRepsBlobs`), `tests/phase21/file-handler-contract.test.cjs`
type: change
rationale: Resolve reported runtime 400 (`GET_REPS_BLOB_FAILED`) after delete representation actions, caused by stale soft-deleted blob tag hits during representation blob enumeration.
impact: Prevents transient/stale Azure tag index entries from breaking representation retrieval, improving reliability of post-delete refresh without relaxing route security contracts.
status: completed
Summary:
- Hardened `getRepsBlobs(containerName)` in `actions/azurestorage.js`:
- fixed async misuse (`blobClient.getProperties().contentLength` without await)
- added existence/property guard with explicit `await blobClient.getProperties()`
- skips 404s (soft-deleted/stale tag index results) instead of throwing
- preserves behavior for non-404 failures (rethrow for proper error visibility)
- kept existing `_rep.json`/`undefined` name filtering intact
- Added phase21 contract coverage for `getrepsblob` route:
- success payload contract test
- dependency failure contract test (`GET_REPS_BLOB_FAILED`)
Validation:
- `node tests/phase21/file-handler-contract.test.cjs` -> pass (25/25)
- `node tests/phase21/api-contract-slice1.test.cjs` -> pass
- helper: 4/4
- file-handler: 25/25
- email-handler: 12/12
- endpoint-handler: 149/149
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.