fix(app): bump happy-dom to fix GC-dependent MutationObserver flake - #46675
Merged
Merged
Conversation
rekram1-node
force-pushed
the
fix-happydom-flake
branch
from
September 1, 2026 20:17
a6ed62c to
b85f62e
Compare
filipeforattini
added a commit
to reddb-io/redcode
that referenced
this pull request
Sep 5, 2026
…nomalyco#46675) Ported from anomalyco/opencode 8100c68. Upstream: 8100c68
filipeforattini
added a commit
to reddb-io/redcode
that referenced
this pull request
Sep 5, 2026
…nomalyco#46675) Ported from anomalyco/opencode 8100c68. Upstream: 8100c68
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.
Summary
The
unit (linux)job ondevhas been flaking onobserve-element-offset.test.ts(e.g. https://github.com/anomalyco/opencode/actions/runs/33552710331/job/100005843576):Root cause is a happy-dom bug, not the test or the timeline code. In
happy-dom@20.9.0(what the lockfile resolved),MutationObserverListenerstores its per-node callback only asnew WeakRef((record) => this.report(record))with nothing holding the closure strongly. If Bun's GC runs betweenobserve()and the DOM mutation, the closure is collected and the observer silently never fires. Whether that happens depends on heap pressure from the ~700 other tests in the same process, hence the flake.This is deterministically reproducible with
Bun.gc(true)betweenobserve()and a mutation, and was fixed upstream in capricorn86/happy-dom#2272 (first shipped in 20.11.2), which keeps a strong#listenerCallbackreference.Change
@happy-dom/global-registrator20.0.11->20.12.0inpackages/app, which pulls inhappy-dom@20.12.0.Verification
Bun.gc(true)before mutation) fails on the old version and passes on 20.12.0packages/appunit suite: 723/724 pass; the one failure (desktop-native.test.tspa-PKlikely-subtags) is pre-existing ondevlocally and passes in CI (macOS vs Linux ICU data), unrelated to this changebun typecheckinpackages/apppasses