• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HSF / phoenix / 34468860991
55%
master: 38%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 10 Sep 2026 11:02AM UTC
Jobs 1
Files 59
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Sep 2026 10:58AM UTC coverage: 47.174% (+0.1%) from 47.049%
34468860991

push

github

web-flow
fix(event-display): clean up XR session listener on session end (#1000)

`onXRSessionStarted` registered the 'end' handler as
`this.onXRSessionEnded.bind(this)`. `bind` returns a new function each
time it is called, so the reference passed to `addEventListener` was
never kept anywhere. `onXRSessionEnded` then tried to remove the
listener by passing the unbound method, which is a different reference,
so the removal silently matched nothing and the listener stayed attached
to the session for as long as the session object lived.

That leak also made the handler re-entrant. A session ends either
because `endXRSession` calls `session.end()` or because the headset ends
it, and both routes fire 'end'. On the second run `currentXRSession` had
already been set to null by the first, so the `removeEventListener` call
on it threw `TypeError: Cannot read properties of null`, and the
`onSessionEnded` callback ran twice. In the AR and VR toggle components
that callback calls `endXR`, so entering and leaving AR twice could
throw and leave `arActive` out of sync with the real session state.

Store the bound listener in a field and remove that exact reference, and
return early when there is no current session so the teardown is safe to
run twice. Also record `currentXRSession` before awaiting
`renderer.xr.setSession`, so a session that ends while that promise is
still in flight is still cleaned up rather than leaving the manager
pinned to a dead session.

Added tests covering that the listener is removed, that the caller is
notified once, and that a second end neither throws nor notifies again.
All three fail before this change.

Fixes #999

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

853 of 2106 branches covered (40.5%)

Branch coverage included in aggregate %.

7 of 8 new or added lines in 1 file covered. (87.5%)

3186 of 6456 relevant lines covered (49.35%)

203.78 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
77.78
18.2% packages/phoenix-event-display/src/managers/three-manager/xr/xr-manager.ts
Jobs
ID Job ID Ran Files Coverage
1 34468860991.1 10 Sep 2026 11:02AM UTC 59
47.17
GitHub Action Run
Source Files on build 34468860991
  • Tree
  • List 59
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #34468860991
  • b2044fc5 on github
  • Prev Build on main (#34251970887)
  • Next Build on main (#34468959179)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc