Skip to content

fix: use private field in #castPlayer getter to avoid side effects#244

Merged
ronald-urbina merged 1 commit intomuxinc:mainfrom
ronald-urbina:fix/castable-mixin-castplayer-private-field
May 6, 2026
Merged

fix: use private field in #castPlayer getter to avoid side effects#244
ronald-urbina merged 1 commit intomuxinc:mainfrom
ronald-urbina:fix/castable-mixin-castplayer-private-field

Conversation

@ronald-urbina
Copy link
Copy Markdown
Contributor

@ronald-urbina ronald-urbina commented May 6, 2026

  • The #castPlayer getter was calling this.remote (the public getter)
    instead of this.#remote (the private field) to look up the cast player
  • this.remote has side effects: it loads the Cast SDK and creates a
    RemotePlayback instance if one doesn't exist yet
  • This means every internal property access (paused, muted, volume,
    currentTime, etc.) was potentially triggering Cast SDK initialization
    unintentionally

Note

Low Risk
Low risk, one-line internal change that prevents unintended Cast SDK/RemotePlayback initialization during internal property reads.

Overview
Updates the #castPlayer getter in castable-mixin.js to reference the private #remote field instead of the public remote getter, avoiding side effects like loading the Cast framework or creating a RemotePlayback instance during internal state access.

Reviewed by Cursor Bugbot for commit 5bb675e. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

@ronald-urbina is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented May 6, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ronald-urbina ronald-urbina merged commit d27f204 into muxinc:main May 6, 2026
5 of 6 checks passed
@github-actions github-actions Bot mentioned this pull request May 6, 2026
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