{"record":{"id":"85625d8717b5dd98","repo":"diegosouzapw/OmniRoute","slug":"rate-limited-85625d","errorCode":"RATE_LIMITED","errorMessage":"Too many messages","messagePattern":"Too many messages","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/server/ws/liveServer.ts","lineNumber":218,"sourceCode":"  const match = auth.match(/^Bearer\\s+(.+)$/i);\n  return match?.[1] || null;\n}\n\n// ── Protocol Handler ──────────────────────────────────────────────────────\n\nfunction handleMessage(clientId: string, raw: string): void {\n  const client = clients.get(clientId);\n  if (!client) return;\n\n  // Rate limiting\n  const now = Date.now();\n  if (now - client.eventCounterReset > 1000) {\n    client.eventCounter = 0;\n    client.eventCounterReset = now;\n  }\n  client.eventCounter++;\n  if (client.eventCounter > MAX_EVENTS_PER_SECOND) {\n    sendTo(client.ws, { type: \"error\", code: \"RATE_LIMITED\", message: \"Too many messages\" });\n    return;\n  }\n\n  let msg: WsClientMessage;\n  try {\n    msg = JSON.parse(raw);\n  } catch {\n    sendTo(client.ws, { type: \"error\", code: \"PARSE_ERROR\", message: \"Invalid JSON\" });\n    return;\n  }\n\n  client.lastActivity = now;\n\n  switch (msg.type) {\n    case \"subscribe\": {\n      client.subscribedChannels = new Set(msg.channels);\n\n      // Send buffered events that match subscribed channels","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/server/ws/liveServer.ts#L200-L236","documentation":"Error \"Too many messages\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/server/ws/liveServer.ts:218 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}