Skip to content

Fix idle-resume visibility listener churn#2399

Draft
ejsmith wants to merge 1 commit into
mainfrom
issue/idle-resume-lockup
Draft

Fix idle-resume visibility listener churn#2399
ejsmith wants to merge 1 commit into
mainfrom
issue/idle-resume-lockup

Conversation

@ejsmith

@ejsmith ejsmith commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • register document visibility tracking once for each DocumentVisibility lifecycle instead of creating child effects from the visible getter
  • keep visibility state reactive for the WebSocket and Intercom consumers
  • add an Intercom regression test covering repeated hidden/resume cycles and token refreshes

Root cause

Reading DocumentVisibility.visible from reactive effects dynamically created another child effect and event listener. When visibility or Intercom boot options changed, those child effects were torn down and recreated. The regression test reproduced 502 visibilitychange registrations across 100 hidden/resume cycles; the updated implementation keeps one registration. This listener/effect churn could eventually trip Svelte's effect_update_depth_exceeded guard and leave the page unresponsive after resuming an idle tab.

Validation

  • npm run validate
  • npm run test:unit -- --run — 299 tests passed
  • focused Intercom/WebSocket tests — 31 tests passed
  • npm run build
  • local frontend and proxied API health checks returned HTTP 200

Breaking changes

None.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Core 73% 65% 9497
Exceptionless.AppHost 38% 40% 139
Exceptionless.Insulation 23% 23% 205
Exceptionless.Web 84% 67% 6898
Summary 76% (22498 / 29436) 65% (10324 / 15822) 16739

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