Repository navigation
Conversation
A clip whose ingest ended in the media service's "error" state never becomes ready, but the library kept asking about it every 5 seconds for as long as the editor stayed open. Such clips now drop out of the poll and their tile says they could not be prepared.
useMediaReady asked about each pending clip in turn and started a new pass every 5 s with setInterval, whether or not the last pass had finished. A pass over a few hundred clips takes minutes, so the passes piled up (over a hundred at once in the test's model) and each one went on asking about every clip, including after the hook had moved on. Passes now run through repeatPasses: the next one starts 5 s after the last finishes, and a pass stops partway once the set it was asked about changes.
This was referenced Oct 10, 2026
Member
Author
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.
Targets
mainand includes #44's commit (same hook). Merge in either order: if #44 merges first, its change is already identical here; if this merges first, #44 has nothing left and can be closed.useMediaReadyasked about each pending clip in turn and started a new pass every 5 s withsetInterval, whether or not the previous pass had finished. A/playbackanswer takes ~1.7 s, so a pass over a few hundred clips runs for minutes. The passes piled up, and each one kept asking about every clip, including after the hook's set had changed:deadwas only checked once the whole loop was done.src/shared/passes.ts:repeatPasses(pass, gapMs)runs a pass, waitsgapMsafter it finishes, then runs the next one. It never runs two at once.stop()cancels the next pass, and the pass under way seesstopped()and gives up partway.useMediaReadyuses it, and checksstopped()before each clip.Test (
test/passes.test.ts): models 400 clips at 1.7 s each against a 5 s gap. Run against the oldsetIntervalloop, the same test reaches 137 passes at once, and it fails 3 of its 4 cases.vitest: 136 passed.footageandhighlightsfail to import@clawnify/queuein my local install, the same as on the base branch.