mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-06 17:37:43 +00:00
perf(background): reduce reactive update lock duration to 1.0s
This commit is contained in:
@@ -634,9 +634,9 @@ function handleServerEvent(event, data) {
|
||||
peer.muted = data.muted !== undefined ? data.muted : peer.muted;
|
||||
|
||||
// Race condition guard: ignore heartbeat playbackState/currentTime
|
||||
// if we applied a reactive user action in the last 1.5 seconds.
|
||||
// if we applied a reactive user action in the last 1.0 second.
|
||||
const timeSinceReactive = peer.lastReactiveUpdate ? (Date.now() - peer.lastReactiveUpdate) : Infinity;
|
||||
const ignoreStatus = timeSinceReactive < 1500;
|
||||
const ignoreStatus = timeSinceReactive < 1000;
|
||||
|
||||
if (!ignoreStatus) {
|
||||
peer.playbackState = data.playbackState !== undefined ? data.playbackState : peer.playbackState;
|
||||
|
||||
Reference in New Issue
Block a user