Skip to content

INTEGRATION [PR#6121 > development/9.2] šŸ› use SUR date instead of the infostore one to have an update LastMod…#6134

Merged
bert-e merged 13 commits intodevelopment/9.2from
w/9.2/bugfix/CLDSRV-878/use-sur-date
Apr 2, 2026
Merged

INTEGRATION [PR#6121 > development/9.2] šŸ› use SUR date instead of the infostore one to have an update LastMod…#6134
bert-e merged 13 commits intodevelopment/9.2from
w/9.2/bugfix/CLDSRV-878/use-sur-date

Conversation

@bert-e
Copy link
Copy Markdown
Contributor

@bert-e bert-e commented Apr 2, 2026

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.2/bugfix/CLDSRV-878/use-sur-date, please follow this
procedure:

 git fetch
 git checkout w/9.2/bugfix/CLDSRV-878/use-sur-date
 # <amend or cancel the changeset by _adding_ new commits>
 git push origin w/9.2/bugfix/CLDSRV-878/use-sur-date

Please always comment pull request #6121 instead of this one.

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
throw errors.InternalError;
}
} else {
bucketMetrics = { date: new Date() };
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildVeeamFileData sets bucketMetrics = { date: new Date() } for system.xml (line 284-285), so the modified date is always the current date. But getFileToBuild (line 202) computes modified = fileToBuild.LastModified || new Date() and discards it — the stored LastModified from metadata is never returned.

This is a behavioral change for system.xml: the Last-Modified header used to reflect the date the file was PUT; now it always returns the current date. It also creates an inconsistency with list.js, which still uses file.LastModified (the stored date) for system.xml entries (list.js line 128-130).

Consider returning modified from getFileToBuild so GET/HEAD can use the stored date for system.xml, matching LIST behavior.

— Claude Code

* @returns {undefined} -
*/
function getVeeamFile(request, response, bucketMd, log) {
async function getVeeamFile(request, response, bucketMd, log) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getVeeamFile, headVeeamFile, and listVeeamFiles are now async, but the caller in routeVeeam.js:167 (return callback(request, response, bucketMd, log)) does not handle the returned promise. If an unexpected error escapes the try/catch blocks (e.g. a TypeError), it becomes an unhandled promise rejection, which crashes the process in modern Node.js.

Consider adding a .catch() at the call site in routeVeeam.js, or wrapping the invocation. The handlers themselves look solid — the risk is at the call site in routeVeeam.js which is not updated in this PR.

— Claude Code

@claude
Copy link
Copy Markdown

claude bot commented Apr 2, 2026

  • system.xml Last-Modified regression (utils.js:285): buildVeeamFileData always uses new Date() for system.xml, discarding the stored LastModified from metadata. This changes GET/HEAD behavior (previously used stored date) and is inconsistent with LIST (which still uses the stored date).
    • Return modified from getFileToBuild so GET/HEAD can use the stored date for system.xml, matching LIST.
  • Unhandled promise rejection risk (get.js:14, head.js:14, list.js:83): The three route handlers are now async, but the caller in routeVeeam.js:167 does not catch the returned promise. An unexpected error escaping the try/catch would crash the process.
    • Add a .catch() at the call site in routeVeeam.js, e.g. return callback(...).catch(err => responseXMLBody(err, null, response, log)).

Review by Claude Code

@bert-e bert-e merged commit c09dc78 into development/9.2 Apr 2, 2026
30 checks passed
@bert-e bert-e deleted the w/9.2/bugfix/CLDSRV-878/use-sur-date branch April 2, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants