fix(sync): cancel superseded canonical apply

This commit is contained in:
Timo
2026-08-26 00:41:54 +02:00
parent 5854c106b8
commit e5110504c1
5 changed files with 189 additions and 10 deletions
+7
View File
@@ -1889,6 +1889,13 @@ function supersedeCanonicalMediaRecovery(reason) {
if (!pending || !markCanonicalMediaStateHandled(roomId, pending.mediaState.revision)) {
return false;
}
// Tracking cancellation alone is insufficient: content.js may still be
// awaiting an asynchronous player action. Invalidate that operation before
// a newer local or remote control is allowed to win.
sendMessageToCurrentContent({
type: 'CANCEL_CANONICAL_MEDIA_STATE',
reason
}).catch(() => {});
addLog(`Canonical media state r${pending.mediaState.revision} superseded by ${reason}`, 'info');
return true;
}