TASK22269: reuse contentLength locals in touched azurestorage blob loops
This commit is contained in:
@@ -273,6 +273,7 @@ export const getBlobs = async (containerName, casefolderID) => {
|
||||
})) {
|
||||
const blobPathParts = blob.name.split("/");
|
||||
const fileName = blobPathParts[2];
|
||||
const contentLength = blob.properties.contentLength;
|
||||
|
||||
blobObj.push({
|
||||
"name": fileName,
|
||||
@@ -281,8 +282,8 @@ export const getBlobs = async (containerName, casefolderID) => {
|
||||
"versionId": blob.versionId,
|
||||
"caseObj": buildCaseObjectPath(casefolderID),
|
||||
"isCurrentVersion": blob.isCurrentVersion,
|
||||
"contentLength": blob.properties.contentLength,
|
||||
"size": blob.properties.contentLength,
|
||||
"contentLength": contentLength,
|
||||
"size": contentLength,
|
||||
"contentType": blob.contentType,
|
||||
"lastModified": blob.properties.lastModified,
|
||||
"filepath": buildDownloadBlobQueryPath({
|
||||
@@ -1295,6 +1296,7 @@ export const getProgressBlobs = async (containerName, caseReference) => {
|
||||
})) {
|
||||
const blobPathParts = blob.name.split("/");
|
||||
const appealBlobName = blobPathParts[1];
|
||||
const contentLength = blob.properties.contentLength;
|
||||
|
||||
consoleLogger("getProgressBlobs in here", blobPathParts);
|
||||
blobObj.push({
|
||||
@@ -1303,7 +1305,7 @@ export const getProgressBlobs = async (containerName, caseReference) => {
|
||||
"versionId": blob.versionId,
|
||||
"caseObj": buildCaseObjectPath(caseReference),
|
||||
"isCurrentVersion": blob.isCurrentVersion,
|
||||
"contentLength": blob.properties.contentLength,
|
||||
"contentLength": contentLength,
|
||||
"contentType": blob.contentType,
|
||||
"lastModified": blob.properties.lastModified,
|
||||
...buildHashMetadataPaths({
|
||||
@@ -1476,6 +1478,7 @@ export const getRepsFilesBlobs = async (
|
||||
const blobPathParts = blob.name.split("/");
|
||||
const casefolderPath = blobPathParts[0] + "/" + blobPathParts[1];
|
||||
const repFileName = blobPathParts[3];
|
||||
const contentLength = blob.properties.contentLength;
|
||||
|
||||
consoleLogger(blob.name);
|
||||
|
||||
@@ -1485,7 +1488,7 @@ export const getRepsFilesBlobs = async (
|
||||
"documentType": getDocumentTypeFromFilename(repFileName),
|
||||
"versionId": blob.versionId,
|
||||
"isCurrentVersion": blob.isCurrentVersion,
|
||||
"contentLength": blob.properties.contentLength,
|
||||
"contentLength": contentLength,
|
||||
"filenameprefix": filenamePrefix,
|
||||
"filepath": buildDownloadBlobQueryPath({
|
||||
containerName,
|
||||
|
||||
@@ -3162,3 +3162,35 @@ Validation:
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
### 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.
|
||||
|
||||
Reference in New Issue
Block a user