Skip to content

FIX: Render each video in a post with its own status - #107

Merged
ZogStriP merged 1 commit into
perf-video-post-queriesfrom
fix-video-status-per-embed
Oct 23, 2026
Merged

ZogStriP merged 1 commit into
perf-video-post-queriesfrom
fix-video-status-per-embed

Conversation

@ZogStriP

@ZogStriP ZogStriP commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Previously, renderVideos applied every entry of post.discourse_video to every video embed in the post, and an entry for another video fell through to the pending placeholder. In a post with several videos, an errored video could show as pending depending on the order of the entries, and an embed of an unknown video id always did. A video embedded twice, which has one entry per embed, got two players in each embed and two download links.

This change looks up the status of each embed's own video, as the code did before 723959a (#25). Embeds without a status are left untouched, as they already were in posts without any status.

It also adds acceptance tests for per-embed statuses and repeated embeds.

Part of a stack of PRs, to be merged in order:

  1. FIX: Show a poster for Mux videos and play them inline on mobile #103
  2. FIX: Update the right posts when a Mux video becomes ready #104
  3. DEV: Simplify the webhook, playback lookup and their specs #105
  4. PERF: Cut per-post queries and table scans for post videos #106
  5. FIX: Render each video in a post with its own status #107 👈 this PR
  6. DEV: Simplify video rendering and consolidate its tests #108
  7. UX: Use sentence case for video strings and fix the preview placeholder #109
  8. FIX: Show video changes in posts without reloading the topic #110
  9. PERF: Load video streams only once playback starts #111
  10. DEV: Move video rendering into a module #112
  11. FIX: Restore video embeds in chat messages #113

Previously, `renderVideos` applied every entry of `post.discourse_video`
to every video embed in the post, and an entry for another video fell
through to the pending placeholder. In a post with several videos, an
errored video could show as pending depending on the order of the
entries, and an embed of an unknown video id always did. A video
embedded twice, which has one entry per embed, got two players in each
embed and two download links.

This change looks up the status of each embed's own video, as the code
did before 723959a (#25). Embeds without a status are left untouched,
as they already were in posts without any status.

It also adds acceptance tests for per-embed statuses and repeated
embeds.
@ZogStriP
ZogStriP merged commit 8d1663c into main Oct 23, 2026
7 checks passed
@ZogStriP
ZogStriP deleted the fix-video-status-per-embed branch October 23, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants