Skip to content

JCU: SSR idle timer only in the browser, drain xhr2 redirect bodies - #1639

Merged
milanmajchrak merged 1 commit into
customer/jcufrom
jcu/fe-ssr-idle-timer-redirect-drain
Oct 20, 2026
Merged

milanmajchrak merged 1 commit into
customer/jcufrom
jcu/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

Port of TUL PR 1597 (commit 6a74ddb), written for the 9.x code. On the server the idleness timer kept every finished render in memory until it fired, and redirect responses that xhr2 follows kept their socket busy.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@milanmajchrak
milanmajchrak merged commit 799f231 into customer/jcu Oct 20, 2026
5 checks passed
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