Refactor: Behebung Force-Sync ACK-Zaehler-Inflation, SHA-256 Hashing, Room-ID-Desinfizierung, Reduzierung MIN_SEEK_DELTA auf 2s und seekDebounce auf 300ms

This commit is contained in:
Timo
2026-05-30 02:00:17 +02:00
parent e2b76b05a1
commit f7096edd30
6 changed files with 30 additions and 27 deletions
+4 -1
View File
@@ -788,6 +788,8 @@ function handleServerEvent(event, data) {
}
if (isForceSyncInitiator) {
forceSyncAcks.delete(data.peerId);
chrome.storage.session.set({ forceSyncAcks: Array.from(forceSyncAcks) });
expectedAcksCount = Math.max(1, currentRoom.peers ? currentRoom.peers.length : 1);
chrome.storage.session.set({ expectedAcksCount });
if (forceSyncAcks.size >= expectedAcksCount) {
@@ -1225,7 +1227,8 @@ async function handleAsyncMessage(message, sender, sendResponse) {
emit(EVENTS.GET_ROOMS, {});
sendResponse({ status: 'ok' });
} else if (message.type === 'WEB_JOIN_REQUEST') {
const { roomId, password, useCustomServer, serverUrl } = message;
const { roomId: rawRoomId, password, useCustomServer, serverUrl } = message;
const roomId = typeof rawRoomId === 'string' ? rawRoomId.replace(/[^a-zA-Z0-9\-]/g, '') : '';
chrome.storage.sync.set({
roomId,
password,