Include a widget's revision in the playlist change signature

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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uaeo9MvzKoyXuN6ZsbhtkL
This commit is contained in:
Claude 2026-07-30 20:03:32 -05:00
parent cad19abee1
commit 6e3be7a95a

View file

@ -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() ?: "")