MCPcopy
hub / github.com/simstudioai/sim / cleanupPendingVariablesForSocket

Function cleanupPendingVariablesForSocket

apps/realtime/src/handlers/variables.ts:30–38  ·  view source on GitHub ↗
(socketId: string)

Source from the content-addressed store, hash-verified

28 * Removes the socket's operationIds from pending updates to prevent memory leaks.
29 */
30export 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
40export function setupVariablesHandlers(socket: AuthenticatedSocket, roomManager: IRoomManager) {
41 socket.on('variable-update', async (data) => {

Callers 1

setupConnectionHandlersFunction · 0.90

Calls 1

deleteMethod · 0.65

Tested by

no test coverage detected