MCPcopy Index your code
hub / github.com/simstudioai/sim / cleanupPendingSubblocksForSocket

Function cleanupPendingSubblocksForSocket

apps/realtime/src/handlers/subblocks.ts:32–43  ·  view source on GitHub ↗
(socketId: string)

Source from the content-addressed store, hash-verified

30 * Removes the socket's operationIds from pending updates to prevent memory leaks.
31 */
32export function cleanupPendingSubblocksForSocket(socketId: string): void {
33 for (const [, pending] of pendingSubblockUpdates.entries()) {
34 // Remove this socket's operation entries
35 for (const [opId, sid] of pending.opToSocket.entries()) {
36 if (sid === socketId) {
37 pending.opToSocket.delete(opId)
38 }
39 }
40 // If no more operations are waiting, the timeout will still fire and flush
41 // This is fine - the update will still persist, just no confirmation to send
42 }
43}
44
45export function setupSubblocksHandlers(socket: AuthenticatedSocket, roomManager: IRoomManager) {
46 socket.on('subblock-update', async (data) => {

Callers 1

setupConnectionHandlersFunction · 0.90

Calls 1

deleteMethod · 0.65

Tested by

no test coverage detected