fix(syncplay): report latency pings for timely commands
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped

SyncPlay expects Ping as a latency in milliseconds, not a timestamp. Date.now() was clamped to 10s and delayed scheduled unpause/seek commands. Send a 50 ms latency every 3 seconds while in a group.
This commit is contained in:
1xDed committed 2026-11-29 08:41:08 +03:00
1 parent 31826f1098
commit e89932fc7d
2 files changed
+27 -1

No files matched your search

+13
View File
@@ -219,6 +219,19 @@ export const pauseSyncPlayGroup = async (api: Api) => {
}
};
export const pingSyncPlayGroup = async (api: Api) => {
try {
await syncApi(api).syncPlayPing({
// This is the measured latency in milliseconds, not a timestamp.
// The server clamps it to 10s; a huge value would delay every
// scheduled pause/unpause, so report a conservative local value.
pingRequestDto: { Ping: 50 },
});
} catch (error) {
console.warn("Could not ping SyncPlay group", error);
}
};
export const resumeSyncPlayGroup = async (api: Api) => {
try {
await syncApi(api).syncPlayUnpause();