(socketId: string)
| 28 | * Removes the socket's operationIds from pending updates to prevent memory leaks. |
| 29 | */ |
| 30 | export function cleanupPendingVariablesForSocket(socketId: string): void { |
| 31 | for (const [, pending] of pendingVariableUpdates.entries()) { |
| 32 | for (const [opId, sid] of pending.opToSocket.entries()) { |
| 33 | if (sid === socketId) { |
| 34 | pending.opToSocket.delete(opId) |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | export function setupVariablesHandlers(socket: AuthenticatedSocket, roomManager: IRoomManager) { |
| 41 | socket.on('variable-update', async (data) => { |
no test coverage detected