Repository navigation
fix(client): apply the worker deadlines in the visible tab only - #342
Merged
ttbombadil merged 1 commit intoOct 24, 2026
Merged
Conversation
Plan 4.5 says the supervision checks a hidden tab only after its return, so that a throttled or frozen tab does not end a healthy run; the runtime did not look at the visibility. Silence now counts from the return and a deadline that runs out while hidden starts again. SSOT, plan and ADR 0009 (E12 thresholds, which P0.3 measured) name the deadlines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
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.
Worum es geht
Fund bei der Konsistenzprüfung: Plan 4.5 legt fest, dass die Fristen der Worker-Überwachung nur im sichtbaren Tab gelten („dort prüft der Hauptthread erst nach der Rückkehr, damit kein falscher Ausfall entsteht“).
BrowserRuntimefragte die Sichtbarkeit nirgends ab. Ein Browser, der einen Hintergrund-Tab drosselt oder einfriert (Chrome nach einigen Minuten, mobile Browser sofort), konnte so nach der Rückkehr einen gesunden Lauf mit „the emulator stopped responding“ beenden.Änderung
client/src/lib/runtime/browser-runtime.ts: Solange der Tab verborgen ist (document.visibilityState), zählt Stille nicht; sie zählt ab der Rückkehr. Läuft eine Befehlsfrist im verborgenen Tab ab, beginnt sie neu, statt den Lauf zu beenden.stopbeendet den Worker weiterhin nach 2 s, das ist auch im verborgenen Tab unschädlich. Die Sichtbarkeit ist für Tests injizierbar (isHidden).Proposed.Tests
browser-runtime.test.ts: Stille im verborgenen Tab, Frist im verborgenen Tab, unbestätigter Befehl nach der Rückkehr. Gegenprobe: Ohne die Änderung sind die ersten beiden rot.setup()bekommt nur zusätzlich den Sichtbarkeitsschaltertab(Vorgabe: sichtbar).tests/client/lib/runtime: 99 Tests grün;npm run check,npm run lintgrün.🤖 Generated with Claude Code