This repository was archived by the owner on Apr 22, 2026. It is now read-only.
Fix race: guard this.playerProxy against becoming null during awaits in PanelButton#303
Open
RobRobM wants to merge 3 commits intosakithb:mainfrom
Open
Fix race: guard this.playerProxy against becoming null during awaits in PanelButton#303RobRobM wants to merge 3 commits intosakithb:mainfrom
RobRobM wants to merge 3 commits intosakithb:mainfrom
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a
TypeError: can't access property "metadata", this.playerProxy is nullcrash inPanelButton.addMenuImage()(and the same race shape inaddMenuSlider()) that fires during rapid track/player transitions (e.g. browser-MPRIS players switching tracks on Radio Paradise).Stack trace shape:
Root cause
PanelButton.addMenuImage()andaddMenuSlider()both readthis.playerProxy.metadata/this.playerProxy.rateafter anawait. During that suspension,setActivePlayer()can swapthis.playerProxyto another player, or aNameOwnerChangedcan drop the current one — so by the time the coroutine resumes,this.playerProxyisnulland property access throws.Fix
#isValidProxy()helper onPanelButtonthat checks the proxy is still non-null and not flaggedisInvalid.awaitcode inaddMenuImage()andaddMenuSlider()on that helper; return early if the proxy has been swapped/dropped.No behavior change on the happy path — guards only trigger when the proxy has already been replaced by the time the
awaitresumes, in which case further UI work on the stale proxy would be pointless anyway.Test plan
playerProxy is nullentries injournalctl --user.Notes
This addresses a crash only. It does not change player selection logic; the "player vanishes from the panel on track change" behavior some browser-MPRIS sources exhibit has a separate root cause (transient empty
xesam:titlemarking the player invalid) which I intend to address in a follow-up PR.May be related to the log-spam reports in #196.