Skip to content

fix(event-display): release resources when removing labels - #1051

Merged
EdwardMoyse merged 1 commit into
HSF:mainfrom
dhairyajangir:fix/release-label-resources-20261101
Nov 1, 2026
Merged

EdwardMoyse merged 1 commit into
HSF:mainfrom
dhairyajangir:fix/release-label-resources-20261101

Conversation

@dhairyajangir

@dhairyajangir dhairyajangir commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Removing or replacing a label can leave its old camera-change callback registered and its detached text geometry/material undisposed. Event clearing can retain these label resources too. This change owns the original controls/callback pair per label ID, releases it on removal/replacement/clear, and disposes the detached glyph. Label lookup stays inside the Labels group so a same-named physics object is preserved.

Four regressions cover removal, replacement with different controls, replacement after an object UUID changes, and repeated event clearing. They also check that unrelated camera listeners survive and replacement text still follows the camera. The unchanged regression file fails all four cases on base 2329146181f72c62285ddf1d3f6450a184adc98b and passes with this change.

Validation (Node 22.22.1 / Yarn 3.3.1):

  • yarn workspace phoenix-event-display build — passed.
  • yarn lint — passed.
  • Four targeted scene/selection/grid/lifecycle suites — 49 tests passed.
  • yarn test:ci — core 423 tests passed; Angular 244 tests passed and 7 skipped; root exit 0.
  • yarn docs:coverage — 100%, passed.

The resource-lifecycle regressions use actual OrbitControls, Font and TextGeometry in jsdom. Browser/WebGL rendering and measured heap/GPU reclamation were not assessed. The upstream Node 20 build and tests and smoke tests passed on 7a87ef97. PR-title and commit-message checks also passed.

Implementation and regression-test preparation used AI assistance.

Track the original camera controls and callback per label ID so removal,
replacement and event clearing unsubscribe the listener that owns the old
glyph. Dispose removed text geometry/material without touching a same-named
physics object.

Cover listener ownership, rebuilt object UUIDs, unrelated listeners and
repeated event clearing with real OrbitControls and text geometry.
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

🚀 Preview deployed: http://phoenix-pr-1051.surge.sh

Built from 7a87ef9.

@EdwardMoyse

Copy link
Copy Markdown
Member

Thanks!

@EdwardMoyse
EdwardMoyse merged commit b2ae182 into HSF:main Nov 1, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
pull-request — 7a87ef97 Deployed Nov 1, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants