Repository navigation
VI-5068 Keep re-checking an embed source until its flow has something to show - #24
Merged
Merged
Conversation
A recording that starts while /embed is open never grew an Open button; a reload produced one immediately. The row was examined once, too early, and the verdict was cached forever: any flow that was not growing went into the closed cache and was never fetched again. An empty flow is not a finished one though -- a store may create the flow when the recording is scheduled and fill it only once the ingest starts -- so the first look, taken before any segment exists, permanently decided that the source had nothing to offer. Cache on settled instead of on not-growing. Settled means nothing further can change the row: the flow is closed, or it already carries media. Awaiting content, ingesting, or simply empty so far all stay under review, so the 5s sources poll re-examines them and the button appears on its own. The escape hatch that re-opens an ingesting source also missed the case it was written for: useIngestingFlows reports the source the flow hangs off, which for a multi-source recording is the video child, while the row on display is the parent collection. Collection members are now matched too. "Loading..." is held to sources with nothing on screen yet, so re-checking an empty flow every 5s does not blink it forever. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Ticket
VI-5068 — [tamstool] Upgrade TAMS Store Browser to TAMS 8.2
Follows #23, which made a live source openable at all. This makes it become openable while you watch.
The bug
With
/#/embedopen, a recording that starts never grows an Open button. Reloading the page produces one immediately. Reported against an 8.2 store; pre-8.2 stores transition correctly.Why
Every source was examined once and the verdict cached forever:
closedRefwas filled by not growing, which is not the same as finished. A store may create the flow when the recording is scheduled and only fill it once the ingest starts, so the first look — taken before any segment exists, with the flow readingawaiting_contentor simply empty — permanently decided that the source had nothing to offer. Nothing re-examines a cached source, so the row stays without a button until the cache dies with the page. That is exactly the reload asymmetry: a reload starts with an empty cache and looks again at a moment when segments do exist.This is 8.2-shaped because 8.2 gives the flow a
statusfrom creation, so the flow is visible and classifiable before it holds anything. Where a store instead has no flow at all until the ingest starts, the first look hitsif (!flow) return, which never cached anything — the source stayed under review and the transition worked.The escape hatch added in #20 was meant to cover this, and misses the case it was written for:
liveSourceIdscomes fromuseIngestingFlows, i.e. the id of the source the flow hangs off. For a multi-source recording that is the video child, while the row on display is the parent collection — so the delete finds nothing and the parent stays cached.The fix
Cache on settled, not on not-growing:
Nothing further can change the row once the flow is closed, or once it already carries media.
awaiting_content,ingesting, and "empty so far" all stay under review, so the existing 5s sources poll re-examines them and the button appears by itself.closedRefis renamedsettledRefto say so.The escape hatch now also matches collection members, so an ingesting video child re-opens the parent row that displays it.
"Loading..."is held to sources with nothing on screen yet — otherwise re-checking a permanently empty flow every 5s would blink it forever.What this does not change
A flow that never receives a segment is re-checked every 5s for as long as the embed is open. That is two requests per such source per poll. It is the price of not guessing, and it stops as soon as the flow closes.
Testing
npm run buildpasses (Node 22, same as CI)npm run lintstill cannot run in this repo (ESLint 9 needs a flat config, deliberately left out of VI-5068 Support TAMS 8.2 in the TAMS Store Browser #20) — the build is the gateNot reproduced against a live store — I have no ingesting 8.2 endpoint, so this is a code-level diagnosis of an asymmetry the reporter observed (8.2 store fails, pre-8.2 store transitions, reload always fixes it). The fix is deliberately robust to each variant of the same trap rather than to one guessed sequence: no flow yet, flow present but empty, flow
awaiting_content, and the child/parent id mismatch all now stay under review. Worth confirming on the store that first showed it.🤖 Generated with Claude Code