TASK22269: reuse contentLength locals in touched azurestorage blob loops

This commit is contained in:
2026-03-26 11:36:47 +00:00
parent 48878e9ebd
commit 830e36d0c4
2 changed files with 39 additions and 4 deletions
+7 -4
View File
@@ -273,6 +273,7 @@ export const getBlobs = async (containerName, casefolderID) => {
})) { })) {
const blobPathParts = blob.name.split("/"); const blobPathParts = blob.name.split("/");
const fileName = blobPathParts[2]; const fileName = blobPathParts[2];
const contentLength = blob.properties.contentLength;
blobObj.push({ blobObj.push({
"name": fileName, "name": fileName,
@@ -281,8 +282,8 @@ export const getBlobs = async (containerName, casefolderID) => {
"versionId": blob.versionId, "versionId": blob.versionId,
"caseObj": buildCaseObjectPath(casefolderID), "caseObj": buildCaseObjectPath(casefolderID),
"isCurrentVersion": blob.isCurrentVersion, "isCurrentVersion": blob.isCurrentVersion,
"contentLength": blob.properties.contentLength, "contentLength": contentLength,
"size": blob.properties.contentLength, "size": contentLength,
"contentType": blob.contentType, "contentType": blob.contentType,
"lastModified": blob.properties.lastModified, "lastModified": blob.properties.lastModified,
"filepath": buildDownloadBlobQueryPath({ "filepath": buildDownloadBlobQueryPath({
@@ -1295,6 +1296,7 @@ export const getProgressBlobs = async (containerName, caseReference) => {
})) { })) {
const blobPathParts = blob.name.split("/"); const blobPathParts = blob.name.split("/");
const appealBlobName = blobPathParts[1]; const appealBlobName = blobPathParts[1];
const contentLength = blob.properties.contentLength;
consoleLogger("getProgressBlobs in here", blobPathParts); consoleLogger("getProgressBlobs in here", blobPathParts);
blobObj.push({ blobObj.push({
@@ -1303,7 +1305,7 @@ export const getProgressBlobs = async (containerName, caseReference) => {
"versionId": blob.versionId, "versionId": blob.versionId,
"caseObj": buildCaseObjectPath(caseReference), "caseObj": buildCaseObjectPath(caseReference),
"isCurrentVersion": blob.isCurrentVersion, "isCurrentVersion": blob.isCurrentVersion,
"contentLength": blob.properties.contentLength, "contentLength": contentLength,
"contentType": blob.contentType, "contentType": blob.contentType,
"lastModified": blob.properties.lastModified, "lastModified": blob.properties.lastModified,
...buildHashMetadataPaths({ ...buildHashMetadataPaths({
@@ -1476,6 +1478,7 @@ export const getRepsFilesBlobs = async (
const blobPathParts = blob.name.split("/"); const blobPathParts = blob.name.split("/");
const casefolderPath = blobPathParts[0] + "/" + blobPathParts[1]; const casefolderPath = blobPathParts[0] + "/" + blobPathParts[1];
const repFileName = blobPathParts[3]; const repFileName = blobPathParts[3];
const contentLength = blob.properties.contentLength;
consoleLogger(blob.name); consoleLogger(blob.name);
@@ -1485,7 +1488,7 @@ export const getRepsFilesBlobs = async (
"documentType": getDocumentTypeFromFilename(repFileName), "documentType": getDocumentTypeFromFilename(repFileName),
"versionId": blob.versionId, "versionId": blob.versionId,
"isCurrentVersion": blob.isCurrentVersion, "isCurrentVersion": blob.isCurrentVersion,
"contentLength": blob.properties.contentLength, "contentLength": contentLength,
"filenameprefix": filenamePrefix, "filenameprefix": filenamePrefix,
"filepath": buildDownloadBlobQueryPath({ "filepath": buildDownloadBlobQueryPath({
containerName, containerName,
+32
View File
@@ -3162,3 +3162,35 @@ Validation:
Follow-ups: Follow-ups:
- Optional next bounded slice: continue tiny helper reuse in touched functions only if any duplicated path literals remain and can be reduced without behavior change. - Optional next bounded slice: continue tiny helper reuse in touched functions only if any duplicated path literals remain and can be reduced without behavior change.
---
### CL-089: TASK22269 Slice B1.14 — azurestorage touched-function contentLength local reuse
date: 2026-03-26
author: Cline
scope: `actions/azurestorage.js`
type: change
rationale: Execute the next tiny bounded readability slice by reusing local `contentLength` values in touched helper-consumer functions to reduce repeated property access and keep object assembly consistent.
impact: Maintainability/readability improvement only; no route/query/output behavior changes.
status: completed
Summary:
- In touched functions:
- `getBlobs`
- `getProgressBlobs`
- `getRepsFilesBlobs`
- Added local `contentLength` variable (`blob.properties.contentLength`) per loop iteration.
- Replaced repeated inline `blob.properties.contentLength` assignments in object assembly with the local variable.
- Preserved field contracts (`contentLength`, `size`) and values.
Validation:
- `npm run lint` -> pass with warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
- `node tests/phase22/index.test.cjs` -> pass
- `node tests/phase7/service-behaviour.test.cjs` -> pass (13/13)
Follow-ups:
- Optional next bounded slice: stop or switch scope; touched-function micro-tidies in this area are now largely exhausted.