6592: Fix slide media array not syncing with content on media removal#295
Merged
6592: Fix slide media array not syncing with content on media removal#295
Conversation
The media array sent to the API was append-only — removing or replacing media in a content field left stale IRIs in the media array. Additionally, clearing one media field would wipe all media associations including those from other fields. Extract rebuildMediaFromContent utility that derives the media array from content fields on every change, and add tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merged
2 tasks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rebuildMediaFromContent only scanned explicitly tracked mediaFields, which start empty and only get populated when handleMedia is called. This meant the first media change on a slide with multiple media fields would drop media from untouched fields. Now also scans all top-level content keys to catch untracked media arrays. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merged
2 tasks
Feature/hotfix 2.6.1 expand
tuj
approved these changes
Mar 2, 2026
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.
Summary
handleMedia()in slide-manager which was append-only — removing or replacing media in a content field left stale IRIs in themediaarray sent to the APIrebuildMediaFromContent()utility that derives the media array from content fields on every changeRelated
Cross-reference: os2display/display-api-service#347
Test plan
docker compose run --rm playwright npx playwright testdocker compose run --rm playwright npx playwright test e2e/slide-media-sync.spec.jsmediaarray in the PUT request no longer contains the removed media🤖 Generated with Claude Code