mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
perf: add command sequence numbers, episode-aware sync guard, fix echo suppression
- Add monotonically increasing seq per peer (localSeq + lastSeqBySender) - Server relays seq field for stale command detection (backward compatible) - Replace expectedEvents (1500ms timeout) with _suppressTimers (per-type, 300ms) - Fix FORCE_SYNC_ACK missing seq (stale-ACK could trigger premature exec) - Fix episode lobby readyPeers asymmetry (initiator never broadcasted readiness) - Add extractEpisodeId() parsing S01E01/Season 1 Episode 1/Folge 5 patterns - Add isDifferentEpisode() guard blocking sync commands across different episodes - add sameEpisode() for format-tolerant lobby title matching - Guard controlled by autoSyncNextEpisode setting with disable hint in warning - Reduce reactive lock from 1000ms to 300ms (seq numbers handle ordering)
This commit is contained in:
@@ -454,6 +454,7 @@ io.on('connection', (socket) => {
|
||||
// --- S-3: Construct clean relay payload — never forward raw client data ---
|
||||
const relayPayload = {
|
||||
senderId: mapping.peerId,
|
||||
seq: clampNum(data.seq, 0, Number.MAX_SAFE_INTEGER),
|
||||
currentTime: clampNum(data.currentTime, 0, 86400),
|
||||
targetTime: clampNum(data.targetTime, 0, 86400),
|
||||
playbackState: validState(data.playbackState),
|
||||
|
||||
Reference in New Issue
Block a user