fix(viewer): respawn the webview on a video-play D-Bus death, not log+stop - #3031
Merged
Conversation
…+stop - MPVMediaPlayer.play/stop called playVideo/stopVideo directly and, on a webview-gone D-Bus error (NoReply — the webview crashed mid-call), logged ERROR and gave up: a Sentry event for a self-healing condition, and the video stayed dead until the next rotation respawned the webview (Sentry ANTHIAS-1A) - Route both through the same _send_to_webview wrapper the image/page paths use (#3012): reap + respawn + retry once on webview death, injected via set_send_to_webview() in setup() alongside the bus - Genuinely unexpected errors still propagate to play/stop's existing log+clear-state handling; with no wrapper injected (tests/standalone) calls run directly, preserving prior behaviour - Add tests for the routing, respawn-recovery, re-raise, and the no-injection fallback Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
There was a problem hiding this comment.
Pull request overview
This PR updates the viewer’s media playback path (MPVMediaPlayer.play() / stop()) to use the same “webview-gone” D-Bus self-healing wrapper already used by the image/webpage viewing paths, so transient webview crashes during video playback respawn the webview and retry once instead of logging an ERROR and leaving playback broken until the next rotation.
Changes:
- Inject
anthias_viewer.__init__._send_to_webviewintoanthias_viewer.media_playerduringsetup()to share the respawn+retry-once behavior for webview-gone D-Bus errors. - Route
MPVMediaPlayer.play()/stop()D-Bus calls through an optional_call_webview()wrapper (direct call fallback when not injected). - Add unit tests asserting wrapper routing, successful retry behavior, failure propagation handling, and the no-injection fallback behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_media_player.py |
Adds tests covering that play()/stop() route through the injected wrapper and preserve fallback behavior without injection. |
src/anthias_viewer/media_player.py |
Introduces injectable _send_to_webview support and routes playVideo/stopVideo through _call_webview(). |
src/anthias_viewer/__init__.py |
Injects _send_to_webview into the media player module during viewer setup() to enable respawn+retry for video calls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5 tasks
vpetersson
added a commit
that referenced
this pull request
Jun 9, 2026
- CalVer (YYYY.0M.MICRO); still June 2026, micro 2 -> 3 - Gives Sentry a real release boundary: every build since 2026.6.2 reported the same base version (only the +git-hash differed), so resolved-in-next-release never stuck and fixed issues kept reopening on the next event. A version bump lets the deployed fixes actually clear from the board. - Ships the crash/noise fixes merged since 2026.6.2: SQLite WAL + busy timeout (#3015), celery migration-gate (#3016) and asset-probe soft limits (#3017), transient-redis/CancelledError Sentry filtering + redis healthcheck (#3018/#3028), GitHub update-check log level (#3019), webview respawn on D-Bus death at setup and mid-play (#3020/#3031), resilient static-file scan (#3026), Wayland-socket wait (#3030), and Sentry release/board triage tags (#3021/#3025) Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Issues Fixed
Fixes #3027 / Sentry ANTHIAS-1A —
MPVMediaPlayer.play failed: GDBus.Error NoReply: Message recipient disconnected.Description
media_player.py'splay()/stop()calledbus.playVideo/bus.stopVideodirectly and, on any exception, logged at ERROR and returned. When the webview died mid-call this is the exact webview-goneNoReplythat_send_to_webview(#3012) already self-heals forview_image/view_webpage— but the media-player path was never routed through it, so a transient webview crash during playback (1) fired a Sentry event for a self-healing condition and (2) left video dead until the next asset rotation respawned the webview.play/stopthrough the injected_send_to_webviewwrapper: reap + respawn + retry once on a webview-gone D-Bus errorset_send_to_webview()insetup(), right next to the existingset_browser_bus()— keeps the respawn logic (and its global state) in__init__.pyand avoids a circular import (__init__already importsmedia_player)play/stop's existing log-and-clear-_playinghandling; with no wrapper injected (standalone/tests) calls run directly, so prior behaviour is preservedChecklist
🤖 Generated with Claude Code