INTEGRATION [PR#6121 > development/9.3] 🐛 use SUR date instead of the infostore one to have an update LastMod…#6135
Conversation
Call UtilizationService.getUtilizationMetrics for capacity.xml on the HEAD and LIST routes, mirroring the existing pattern from GET. This ensures Last-Modified is derived from SUR metrics (not stale metadata) on all three routes. Fall back to new Date() when metrics are unavailable (404) or absent. Also use new Date() as the fallback in GET instead of the stored LastModified value. Issue: CLDSRV-878
Move the shared UtilizationService call pattern (bucket key derivation, 404 warn/fallback, error logging) into a single fetchCapacityMetrics helper in utils.js, used by GET, HEAD, and LIST routes. Issue: CLDSRV-878
Issue: CLDSRV-878
…into w/9.2/bugfix/CLDSRV-878/use-sur-date
…date' into w/9.3/bugfix/CLDSRV-878/use-sur-date
| throw errors.InternalError; | ||
| } | ||
| } else { | ||
| bucketMetrics = { date: new Date() }; |
There was a problem hiding this comment.
For system.xml, bucketMetrics is set to { date: new Date() }, so modified is always the current time. The old code used the stored LastModified from metadata (the date when system.xml was last PUT). This means every GET/HEAD of system.xml now reports the current time as Last-Modified, which misrepresents when the file was actually modified and could break client-side caching.
Meanwhile, list.js still uses file.LastModified (the stored metadata date) for system.xml entries, creating an inconsistency between GET/HEAD and LIST responses for the same file.
Consider preserving the stored LastModified for system.xml by reading it from getFileToBuild before the LastModified field is deleted.
— Claude Code
| * @returns {undefined} - | ||
| */ | ||
| function getVeeamFile(request, response, bucketMd, log) { | ||
| async function getVeeamFile(request, response, bucketMd, log) { |
There was a problem hiding this comment.
The async route handlers (getVeeamFile, headVeeamFile, listVeeamFiles) now return promises, but the caller in routeVeeam.js:167 (return callback(request, response, bucketMd, log)) ignores the return value since it is inside the final callback of async.waterfall. If any handler throws an unhandled error (e.g. respondWithData throws before its internal try/catch, or responseXMLBody throws), the rejection is never caught, causing an unhandled promise rejection that crashes the Node.js process. Consider adding a .catch() guard in routeVeeam.js or wrapping the top-level of each async handler in a try/catch that covers all code paths.
— Claude Code
Review by Claude Code |
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This pull request has been created automatically.
It is linked to its parent pull request #6121.
Do not edit this pull request directly.
If you need to amend/cancel the changeset on branch
w/9.3/bugfix/CLDSRV-878/use-sur-date, please follow thisprocedure:
git fetch git checkout w/9.3/bugfix/CLDSRV-878/use-sur-date # <amend or cancel the changeset by _adding_ new commits> git push origin w/9.3/bugfix/CLDSRV-878/use-sur-datePlease always comment pull request #6121 instead of this one.