fix(anki): prevent media timing review hangs and invalid ranges

- Reject stale or invalid timing actions
- Fall back to original timing when the renderer stops responding
This commit is contained in:
2026-08-30 01:56:16 -07:00
parent ca27a4275f
commit ec6a106748
8 changed files with 185 additions and 29 deletions
@@ -290,6 +290,7 @@ export class MediaTimingPreviewSession {
settled = true;
clearAttemptTimeout();
socket.off('connect', onConnect);
socket.on('error', () => {});
socket.destroy();
reject(error);
};
@@ -301,6 +302,7 @@ export class MediaTimingPreviewSession {
timeout = null;
socket.off('connect', onConnect);
socket.off('error', onError);
socket.on('error', () => {});
socket.destroy();
reject(new Error('Timed out connecting to the hidden mpv preview player'));
}, timeoutMs);