From 6e3be7a95a377785be2d66e2dfa1eaeb184ad52b Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Jul 2026 20:03:32 -0500 Subject: [PATCH] Include a widget's revision in the playlist change signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The widget-refresh fix did not work, and only the emulator showed it. widget_rev reached the device correctly and the render URL was built from it correctly, but the controller de-duped the update before any of that mattered: sig() keys on content/widget IDENTITY, and a widget's identity does not change when it is edited. The payload was byte-identical, the update was discarded, the old items were kept — including the old rev — so the URL never changed and the WebView reuse held. Measured: the player sat on rev=1785459552 for three full cycles after an edit, logging "Widget already showing, not reloading" each time. Adding widgetRev to the signature is the same move already made for muted (#129), schedules (#74/#75) and transitions — all cases where an edit changes playback without changing identity. Re-verified on the emulator, app left running: edited -> "Showing widget: ...&rev=1785459720" (reload, new rev, no restart) unedited -> 3 x "already showing", 0 reloads over 45s, so the anti-flash reuse is intact Worth recording: the code read correct on all three previous passes. Only running it exposed this. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Uaeo9MvzKoyXuN6ZsbhtkL --- .../com/remotedisplay/player/player/PlaylistController.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/remotedisplay/player/player/PlaylistController.kt b/android/app/src/main/java/com/remotedisplay/player/player/PlaylistController.kt index 7869e13..a940d65 100644 --- a/android/app/src/main/java/com/remotedisplay/player/player/PlaylistController.kt +++ b/android/app/src/main/java/com/remotedisplay/player/player/PlaylistController.kt @@ -193,7 +193,12 @@ class PlaylistController( // so timing edits take effect without interrupting playback or resetting the index. // transition included so a transition-only edit re-renders instead of being de-duped (a // cached-playlist device otherwise silently ignores it — the web/Tizen fingerprint bug). - fun sig(it: PlaylistItem) = it.contentId + "|" + (it.widgetId ?: "") + "|" + (if (it.muted) "m" else "") + "|" + + // widgetRev for the same reason as muted and transition above: a widget's identity does not + // change when it is EDITED, so a content edit produced a byte-identical signature, the + // update was de-duped, and the player kept its old items — including the old rev, so the + // render URL never changed and the WebView reuse held. The screen only caught up on an app + // restart. Found on the emulator; the code read looked correct without it. + fun sig(it: PlaylistItem) = it.contentId + "|" + (it.widgetId ?: "") + "|" + it.widgetRev + "|" + (if (it.muted) "m" else "") + "|" + it.schedules.joinToString(";") { b -> b.days.sorted().joinToString(",") + "@" + b.start + "-" + b.end + ":" + (b.startDate ?: "") + "~" + (b.endDate ?: "") } + "|" + (it.transition?.sig() ?: "")