Repository navigation
CLARIN-DSpace v9: SSR idle timer only in the browser, drain xhr2 redirect bodies - #1642
Open
milanmajchrak wants to merge 2 commits into
Open
milanmajchrak wants to merge 2 commits into
milanmajchrak wants to merge 2 commits into
Conversation
…rect bodies Port of TUL PR 1597 (commit 6a74ddb), written for the 9.x code. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The spec ticked past the deadline, so a timer started on the server would go unnoticed. fakeAsync with flush: false now fails on it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Ports this customer/TUL PR:
The same fix for dtq-dev is #1636 (open).
Description
On the server, two things kept every finished SSR render in memory: the idle timer of
AuthEffectsand the socket of a REST redirect that xhr2 followed without reading the body. The timer now runs only in the browser, and redirect bodies are drained.Instructions for Reviewers
List of changes in this PR:
AuthEffects.trackIdleness$: the firstfilterlets actions through only in the browser.PLATFORM_IDis injected in the constructor.ServerXhrService: wraps xhr2's_onHttpResponseand callsresponse.resume()on 301, 302, 303, 307 and 308.auth.effects.spec.ts: in the browser the user is still set idle aftertimeUntilIdle. On the server no timer starts. That spec runs withfakeAsync(..., { flush: false }), so a pending timer fails it.ServerXhrServicehas no spec. Karma uses the browser build of xhr2.How to test:
npm run test -- --include=src/app/core/auth/auth.effects.spec.ts: 27 specs pass. With the browser filter disabled, the server spec fails with1 periodic timer(s) still in the queue./handle/...requests (each one triggers thepid/find302 on the REST side). The heap of the SSR process goes back down afterwards instead of growing until a restart.Codex review (gpt-6.2-sol, high), 2 rounds: 1 finding fixed (the server spec did not fail on a pending timer), the last round found nothing. Not changed: a Node test for the redirect drain, because the repo has no Node test runner for server code.
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.🤖 Generated with Claude Code