fix(signage-manager): fix playlist approval, adding media and status - #535
Conversation
|
Deployment failed for project frontend-templates with the following error: Learn More: https://vercel.com/placeos?upgradeToPro=build-rate-limit |
|
| if (await playlistChangedSince(playlist_id, shown)) { | ||
| notifyWarn( | ||
| i18n('SIGNAGE_MANAGER.PLAYLIST_CHANGED_BEFORE_APPROVAL'), | ||
| ); | ||
| this._playlist_versions.reload(); | ||
| return; | ||
| } | ||
| await approveSignagePlaylist(playlist_id); |
There was a problem hiding this comment.
There was a problem hiding this comment.
This can't be fully closed in the app; the API has no way to name the revision. ts-client's approveSignagePlaylist(id) is a bare POST /signage/playlists/{id}/media/approve, and its docs say it approves the latest revision. The modal (playlist-approve-modal.component.ts:215) fetches the latest revision just before approving and compares its id and updated_at with the one in the preview; if they differ, it warns and does not approve. What remains is one round trip, between that check and the approve request. A full fix needs the server to accept the revision being approved (a revision_id, or an If-Match/updated_at precondition answered with 409/412), with a matching ts-client argument.
There was a problem hiding this comment.
You're right: with the current bare approveSignagePlaylist(id) endpoint, the modal's reload-and-compare check is the strongest client-side mitigation, but it cannot close the check/approve race. The remaining issue requires an API-level revision precondition (for example revision_id or If-Match/updated_at) and a matching ts-client change. I’m withdrawing this as an app-level finding; it should instead be tracked as a backend/API enhancement.
|
LGTM |
- Fetch a playlist by ID to check distribution when it is not loaded. - Keep a pending approval request when items load. - Send null for cleared validity dates. - Re-check the revision before approving. - Show errors for add-media, item loading and deep links. - One playlistStatus helper for every playlist status badge. - Move items up and down with the keyboard. - Map animation indexes from the backend to their names, and keep a playlist's animation unless the user changes it. - Block the save hotkey while a dropdown has focus.
…ink warnings - reloadPlaylists() retries the failed page first and reloads from page one only when the first page failed, so loaded pages are kept. - A linked playlist that fails to load after the user moved on no longer warns or clears the selection.
c13152c to
7f03208
Compare
On the playlists page and its modals:
valid_untilwas never sent, so expired playlists stayed expired.getStatusdisagreed on expiry and wording.0) into Cut, so saving could silently change a playlist's animation.Changes
false._setPlaylistMediaStatekeeps the server'sapproval_requested.null.isLoading/error, with<load-error>and Retry. Details shows "—" on error.playlistStatushelper for the playlist list, media sidebar, zone and display lists, with one label.playlistAnimation()reads ts-client's'cut'as Default and maps indexes. The modal sendsdefault_animationonly when it changes. Options useMediaAnimationnames. The S hotkey does not save while a dropdown has focus.[(ngModel)]and types.Testing
nx test signage-manager(1001) andnx build signage-managerpass.Notes
SignagePlaylistshould usedata.default_animation ?? MediaAnimation.Cut. After that,playlistAnimationcan become a plain index lookup.playlist-schedule-formstill has its own copy of the old no-schedule fallback; it should use the export from fix(signage-manager): match schedule conflicts to the player #537 after both merge.Independent of the other signage PRs from this review. Based on
develop.Changes made by Claude Opus 5.5 (1M context) in Claude Code, running in T3 Code.
🤖 Generated with Claude Code