fix: remove context reaper to prevent background tabs from going stale (#4)
Some checks failed
CI / Build and Test (push) Failing after 35s

This commit was merged in pull request #4.
This commit is contained in:
2026-02-20 19:11:12 +00:00
parent c0f4782f2b
commit dc56261b58
6 changed files with 1 additions and 274 deletions

View File

@@ -14,7 +14,7 @@ Browser hits page → new Context created → init function runs → HTML render
action fires → signals injected from browser → handler runs → Sync() → DOM patched
```
The context is disposed when the SSE connection closes (tab close, navigation away, network loss). A background reaper also cleans up contexts that never establish an SSE connection within `ContextTTL` (default 30s).
The context lives until the browser tab closes (detected via a `beforeunload` beacon) or the server shuts down. There is no background reaper — contexts persist across temporary SSE disconnections so backgrounded tabs resume seamlessly.
During [SPA navigation](routing-and-navigation.md#spa-navigation), the context itself survives — only page-level state (signals, actions, fields, intervals, subscriptions) is reset. The SSE connection persists.