Skip to content

CLARIN-DSpace v9: SSR idle timer only in the browser, drain xhr2 redirect bodies - #1642

Open
milanmajchrak wants to merge 1 commit into
dtq-dev-9-basefrom
9-base/fe-ssr-idle-timer-redirect-drain
Open

milanmajchrak wants to merge 1 commit into
dtq-dev-9-basefrom
9-base/fe-ssr-idle-timer-redirect-drain

Conversation

@milanmajchrak

@milanmajchrak milanmajchrak commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

References

Port of TUL PR 1597 (commit 6a74ddb). TUL outage on 2026-10-12: SSR workers died at the heap limit during a bot wave on /handle URLs. The mechanism is the same on every branch, TUL was only the first one to hit the limit.

Description

Two things kept every finished SSR render in memory: the 15-minute idleness timer of AuthEffects, and the socket of REST redirects that xhr2 follows without reading the body (the pid/find 302 behind every /handle/... page). The timer now runs only in the browser and the redirect bodies are drained.

Instructions for Reviewers

  • AuthEffects.trackIdleness$: filter(() => isPlatformBrowser(this.platformId)) comes first, PLATFORM_ID is injected in the constructor
  • ServerXhrService: wraps xhr2's _onHttpResponse and calls response.resume() on 301, 302, 303, 307 and 308
  • specs: the browser still marks the user idle after timeUntilIdle, the server starts no timer. ServerXhrService has no spec, Karma uses xhr2's browser build
  • written for the 9.x code (multi-line imports), the logic is identical to TUL PR 1597
  • after deploy: the heap of the SSR process goes back down after a burst of /handle/... requests instead of growing until the restart
  • auth.effects.spec.ts passes locally (27 tests), eslint clean

Checklist

  • My PR is created against the branch it ports to
  • My PR is small in size
  • My PR follows the code conventions and passes ESLint
  • My PR passes all specs and includes new or updated specs
  • My PR includes details on how to test it
  • No new dependencies, no new configuration

🤖 Generated with Claude Code

…rect bodies

Port of TUL PR 1597 (commit 6a74ddb), written for the 9.x code.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant