fix: drop stale deferred autoplay-ready signals on media change

- autoplay-ready gate now stamps pending signal with mediaPath and discards it on flush if media has changed
- tokenization warm release skips signaling when current media path is cleared (null)
- tighten regex matchers in main-wiring and overlay-legacy-cleanup tests
This commit is contained in:
2026-05-19 21:12:58 -07:00
parent 403ee32579
commit 4813ce1fea
6 changed files with 72 additions and 6 deletions
@@ -67,3 +67,20 @@ test('autoplay tokenization warm release skips stale media after warmup resolves
assert.deepEqual(calls, ['warmup']);
});
test('autoplay tokenization warm release skips signaling when current media is cleared', () => {
const calls: string[] = [];
const release = createAutoplayTokenizationWarmRelease({
isTokenizationWarmupReady: () => true,
startTokenizationWarmups: async () => {
calls.push('warmup');
},
getCurrentMediaPath: () => null,
signalAutoplayReady: () => calls.push('signal'),
warn: () => {},
});
release('/tmp/video.mkv');
assert.deepEqual(calls, []);
});