fix(stories): retain the last shot when replaying near the end (#1724)

Focused follow-up to manjunath22466's Stories contribution.
A paused share link in the final 250 ms is not a completed scene.
Add node:test coverage for near-end Play and true-end replay; update
current-state documentation and the #1724 changelog fragment.
This commit is contained in:
Kevin Rajan authored and Manjunath committed 2026-11-16 20:45:25 +05:30
1 parent b8e622aac8
commit 8a0953c35d
4 files changed
+37 -3

No files matched your search

+3 -1
View File
@@ -87,7 +87,9 @@ export function createGevPlayer(director, story, hooks = {}) {
const mine = ++request;
await idle();
if (destroyed || mine !== request || director.running) return;
if (wallMs >= durationMs - 250) {
// Natural completion is rounded up by the clock subscriber; a
// paused shared time inside the last 250 ms is not completion.
if (wallMs >= durationMs) {
wallMs = 0;
shotIndex = 0;
}