mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-31 13:08:15 +00:00
fix(host-control-mode): re-query host pos when captured target is unusable
Audit follow-up on the snap-back paths. The immediate involuntary snap used the captured target directly; if it was null/invalid (host position not known yet, e.g. before the first host heartbeat) hcmSnapBackToHost no-ops and the guest is left silently paused with no dialog and no retry. The deferred and "Stay in sync" paths already re-query with retry — make the immediate path fall back to the same when the captured target isn't usable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -261,7 +261,12 @@
|
|||||||
// Buffering/ads/throttle — silently re-sync, no dialog spam.
|
// Buffering/ads/throttle — silently re-sync, no dialog spam.
|
||||||
const video = findVideo();
|
const video = findVideo();
|
||||||
if (video && video.readyState >= 3 && !video.seeking) {
|
if (video && video.readyState >= 3 && !video.seeking) {
|
||||||
hcmSnapBackToHost(target); // ready now → snap immediately
|
// Ready now → snap immediately. Use the captured target if it's
|
||||||
|
// usable, otherwise re-query+retry (host state may not be known yet)
|
||||||
|
// so we never leave the guest silently stuck (consistent with the
|
||||||
|
// deferred and "Stay in sync" paths).
|
||||||
|
if (target && Number.isFinite(target.targetTime)) hcmSnapBackToHost(target);
|
||||||
|
else hcmRequestHostSyncWithRetry();
|
||||||
} else {
|
} else {
|
||||||
hcmDeferredSnapBack(); // buffering → wait for ready, then snap once (#3)
|
hcmDeferredSnapBack(); // buffering → wait for ready, then snap once (#3)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user