This repository was archived by the owner on Apr 22, 2026. It is now read-only.
Keep Playing players valid when xesam:title is transiently empty#304
Open
RobRobM wants to merge 2 commits intosakithb:mainfrom
Open
Keep Playing players valid when xesam:title is transiently empty#304RobRobM wants to merge 2 commits intosakithb:mainfrom
RobRobM wants to merge 2 commits intosakithb:mainfrom
Conversation
Browsers exposing MPRIS for web apps (e.g. Chromium + Radio Paradise) can transiently publish an empty Metadata dict between tracks while PlaybackStatus remains 'Playing'. validatePlayer() then marks the player invalid, setActivePlayer() skips it, and the panel switches to another (typically paused) player. No subsequent PropertiesChanged is guaranteed, so the panel can stay stuck on the wrong player until the next genuine track change fires. Treat PlaybackStatus === Playing as sufficient for validity even without xesam:title, and re-run validatePlayer() on PlaybackStatus changes so Paused/Stopped players with empty metadata are still flagged invalid as before.
PanelButton previously passed the raw xesam:title value straight to ScrollingLabel and into the panel label list. For MPRIS players that omit the key entirely (which now includes Playing players reaching these code paths under the relaxed validatePlayer rule), this yields 'undefined', making ScrollingLabel throw 'Invalid value undefined for property text' — and stopping the IsInvalid listener before updateWidgets for other flags runs. Match the fallback pattern already used for xesam:artist/album and substitute an empty string when the title is missing.
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
Chromium-based browsers (Brave, Chrome, etc.) that forward MediaSession to MPRIS sometimes publish an empty
Metadatadict whilePlaybackStatusstaysPlaying— typically during track transitions on streaming sites such as Radio Paradise. The empty window can last several seconds before real metadata reappears.The current
validatePlayer()marks a player invalid wheneverxesam:titleis missing. That causes the panel to drop the actually-playing browser player and switch to another (often paused) source, and it doesn't recover cleanly when the title returns.Changes
src/helpers/shell/PlayerProxy.jsvalidatePlayer(): a player is only invalid when it has no title and is not currentlyPlaying. APlayingplayer with empty metadata is still a legitimate candidate.validatePlayer()onPlaybackStatuschanges, so aPaused-without-title player that later starts playing becomes valid again (and vice versa).src/helpers/shell/PanelButton.jsxesam:titleto""at the two sites that pass it intoScrollingLabel/labelTextElements. Without this, GObject throwsInvalid value 'undefined' for property textwhen an empty-metadataPlayingplayer reaches the panel widgets, andupdateWidgetsaborts — which defeats the point of keeping the player valid.Root cause / verification
Verified directly on the bus with
gdbus call --session --dest org.mpris.MediaPlayer2.brave.instance_X --object-path /org/mpris/MediaPlayer2 --method org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadataduring a Radio Paradise track transition — the returneda{sv}is{}for up to several seconds whilePlaybackStatusisPlaying. This is not a stale-cache issue inside the extension; the publisher's DBus state is genuinely empty.Test plan
journalctl --user -f | grep gnome-shellstays clean (noScrollingLabelGObject errors, noplayerProxy is null).Notes
main, no merge conflicts expected either way.