Skip to content

Fix SSR response ownership and optional metadata lifecycle - #1713

Open
vidiecan wants to merge 3 commits into
dtq-devfrom
fix/issue-1131-runtime-failures-dtq
Open

vidiecan wants to merge 3 commits into
dtq-devfrom
fix/issue-1131-runtime-failures-dtq

Conversation

@vidiecan

@vidiecan vidiecan commented Nov 4, 2026 •

Copy link
Copy Markdown

Refs dataquest-dev/dspace-customers#1131.

Change set

  • Give stale SSR refresh an independent writable response and request snapshot; preserve the existing path/origin/language cache key. Skip callback writes after a foreground redirect, retaining a constant error diagnostic.
  • Cancel optional signposting at the download decision instead of writing headers after redirect or waiting indefinitely for metadata. Preserve ready links, authorization/file errors, and the signposting setting; use Angular 15-compatible Subject/OnDestroy teardown.
  • Reject committed header/status mutations with one constant diagnostic, without logging request URLs or header values.
  • Gate legacy MenuResolver script probes by administrator authorization. Anonymous menu creation was already skipped on this branch.
  • Add focused regressions, real Express callback/lifecycle tests, and a CI step for the new Node suite. No CI matrix or permissions changes.

Test evidence

DSpace 7.6.5 / Angular 15; Node 20.17.0, Yarn 1.22.22, unchanged yarn.lock.

yarn install --frozen-lockfile               PASS
yarn run lint --quiet                       PASS
madge circular check with model exclusions  PASS: 3003 files, 0 cycles
yarn run build:prod                         PASS: browser + SSR
yarn run test:headless                      5549 successful, 4 skipped
yarn run test:ssr-response-lifecycle         9/9 pass
focused Angular regressions                 53/53 pass
git diff --check                            PASS

Original lifecycle tests: 5 failed /3 passed; corrected 9/9. The callback error-diagnostic regression was separately red before its correction. Tests execute actual functions/classes on Express with a stand-in render engine; they do not claim a full Angular server bootstrap. Full build and headless suite exited 0.

Notes

Fresh branch from dtq-dev; no customer history or Angular 19-only APIs imported. Optional Link metadata is best-effort: if late, it is omitted without delaying redirect. Background request metadata is read-only; its socket/body remain owned by the visitor request.

This integration PR does not deploy or backport the change to a customer branch. The tracking issue remains open for that work.

Focused command (Node 20.17 selected):

node node_modules/@angular/cli/bin/ng.js test --source-map=true --watch=false --configuration test --browsers=ChromeHeadless --include='**/bitstream-download-page.component.spec.ts' --include='**/server-response.service.spec.ts' --include='**/menu.resolver.spec.ts' --code-coverage=false

Circular check used the installed madge 8.0.0 CLI. Portable equivalent (rather than the machine-specific cache path actually executed):

npx --yes --package=madge@8.0.0 madge --exclude '(bitstream|bundle|collection|config-submission-form|eperson|item|version)\.model\.ts$' --circular --extensions ts ./

Circular result includes 109 resolver warnings. Local test environment set NODE_OPTIONS=--max-old-space-size=8192 and CHROME_BIN to installed Chrome.

Upstream overlap checked

Upstream reuse follow-up

Revalidated on b76be16503: Node lifecycle 9/9, full Jasmine 5549 passed / 4 skipped, full lint pass, production browser+SSR build pass (exit 0). Helper equality verified mechanically with line endings normalized. Claude Opus CLI read-only follow-up found no blocker and confirmed the text matches and renderer-scope difference. Fresh CI is running for this head; previous head's checks were green.

jm and others added 3 commits November 4, 2026 01:07
Use the exact createSsrRefreshContext signature and function body from DSpace#6353 at a3f28a8. Keep the existing LRU integration and local lifetime documentation. This is a partial port, not a cherry-pick of the Redis feature.

Co-authored-by: qubiack <krzysztof.kubiak@pcgacademia.pl>
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