Skip to content

test(app): restore stable offset observer ordering - #39901

Merged
kitlangton merged 3 commits into
v2from
observer-test-flake
Jul 31, 2026
Merged

test(app): restore stable offset observer ordering#39901
kitlangton merged 3 commits into
v2from
observer-test-flake

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Restore the stable ordering for the reconnect-aware offset observer test that was previously landed in #38044 and later lost during a branch merge.

Before / After

Before: The test performed unrelated DOM mutations and awaited animation frames before its first reconnect. Happy DOM stores mutation callbacks weakly, so GC could collect the callback during that asynchronous gap and leave the reconnect assertion with no calls.

After: The test verifies the reconnect first, then performs unrelated DOM churn and confirms it adds no callback. Production behavior and coverage remain unchanged, without exposing the test to Happy DOM's weak-callback artifact before its positive assertion.

How

Reorder the existing test phases to match the proven ordering from #38044. A second reconnect still verifies equal offsets are ignored after the unrelated-mutation check.

Scope

Test-only change. No App runtime or timeline implementation changes.

Testing

  • Focused suite repeated 500 times: 3,500/3,500 tests passed
  • bun test --preload ./happydom.ts ./src/pages/session/timeline/observe-element-offset.test.ts
  • bun typecheck
  • Push hook: monorepo typecheck, 33/33 tasks passed
  • Full App unit suite: 684 passed; one unrelated existing i18n parity failure for missing Arabic keys

@kitlangton
kitlangton merged commit 7757f71 into v2 Jul 31, 2026
11 of 12 checks passed
@kitlangton
kitlangton deleted the observer-test-flake branch July 31, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant