Conversation
|
@R-Delfino95 is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1273 +/- ##
==========================================
- Coverage 78.55% 73.62% -4.94%
==========================================
Files 59 56 -3
Lines 11080 13857 +2777
Branches 0 785 +785
==========================================
+ Hits 8704 10202 +1498
- Misses 2376 3622 +1246
- Partials 0 33 +33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| this.#mediaStore?.dispatch({ | ||
| type: 'fullscreenelementchangerequest', | ||
| detail: undefined, | ||
| }); |
There was a problem hiding this comment.
Fullscreen element state owner not restored on reconnect
High Severity
The new fullscreenelementchangerequest dispatch with undefined in disconnectedCallback clears the fullscreenElement state owner, but connectedCallback has no matching dispatch to restore it. The #mediaStore is never nulled on disconnect, so #setupDefaultStore() won't re-run on reconnect. Compare with documentelementchangerequest, which is restored in connectedCallback with document, and mediaelementchangerequest, which is restored via mediaSetCallback. After a disconnect/reconnect cycle, fullscreenElement remains undefined in the store, breaking fullscreen functionality.
Additional Locations (1)
| this.#mediaStore?.dispatch({ | ||
| type: 'mediaelementchangerequest', | ||
| detail: undefined, | ||
| }); |
There was a problem hiding this comment.
Redundant mediaelementchangerequest dispatch in disconnectedCallback
Low Severity
The mediaelementchangerequest dispatch with undefined is redundant. super.disconnectedCallback() on line 471 already triggers mediaUnsetCallback, which dispatches the exact same action (as seen in mediaUnsetCallback at line 545-548). This duplicate dispatch does no harm but adds unnecessary noise to the teardown logic.


Description
This PR addresses specific edge cases in
media-controllerthat were not covered in previous updates. The goal is to handle a few remaining cleanup tasks and state ownership issues identified after #1261.Changes:
stateOwnersare cleared from themediaStorewhen the controller is disconnected.disconnectedCallback()instead of usingtoggleRangeAnimation().Related Issues
Relates to Issue #1235
Follow-up to PR #1261
Testing Instructions
mux-player-react, see the example in PR #1285.stateOwnersare no longer present inmediaStoreafter disposal.media-time-rangeanimations cease correctly upon component disconnection.Note
Medium Risk
Moderate risk because it changes teardown behavior by explicitly clearing MediaStore-owned element references and removing UI elements, which could affect re-mount/reconnect flows if any code relies on prior state persisting.
Overview
Fixes several teardown-related memory leaks by strengthening
disconnectedCallback()cleanup across components.media-controllernow clears MediaStore “state owner” references (media/fullscreen/document elements) on disconnect and explicitly removes the keyboard shortcuts dialog from the DOM.media-time-rangestops itsRangeAnimationdirectly on disconnect, andmedia-container/media-chrome-menureset pending/retained internal references (#isResizePending, focus/invoker pointers) to avoid lingering callbacks and DOM references.Written by Cursor Bugbot for commit e9595a4. This will update automatically on new commits. Configure here.