refactor(actions): fix document download helper contract
This commit is contained in:
@@ -1991,3 +1991,31 @@ Validation:
|
||||
Follow-ups:
|
||||
|
||||
- Optional next bounded slice: isolate and correct `downloadBlob` behavior in `documentDirectService` (including legacy `res` usage) behind an explicit, tested contract.
|
||||
|
||||
---
|
||||
|
||||
### CL-056: TASK22260 next slice — document direct service download helper contract fix
|
||||
|
||||
date: 2026-03-25
|
||||
author: Cline
|
||||
scope: `actions/services/documentDirectService.js`
|
||||
type: change
|
||||
rationale: Execute the next bounded follow-up by correcting the legacy `downloadBlob` service helper path that still relied on invalid `res` references and direct axios usage, aligning it to shared request client behavior.
|
||||
impact: Fixes a service-layer contract defect risk in document download helper and improves consistency by using shared request client patterns; no endpoint contract change.
|
||||
status: completed
|
||||
|
||||
Summary:
|
||||
|
||||
- Refactored `downloadBlob(containerName, blobName)` in `documentDirectService`:
|
||||
- removed legacy direct `axios.get(...).then(response => res.status(...))` pattern that referenced undefined `res` in service layer
|
||||
- now returns blob response data via `requestJson({ method: "get", url, responseType: "blob" })`
|
||||
- preserved catch-path logging (`consoleLogger`)
|
||||
- Removed now-unused module-level `axios` import from `documentDirectService`.
|
||||
|
||||
Validation:
|
||||
|
||||
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||
|
||||
Follow-ups:
|
||||
|
||||
- Optional next bounded slice: add a focused test (or integration harness assertion) around `downloadBlob` service return contract to prevent regression to response-object assumptions.
|
||||
|
||||
Reference in New Issue
Block a user