{"record":{"id":"a78fdc1980c60982","repo":"diegosouzapw/OmniRoute","slug":"refusing-to-persist-ratelimitoverrides-with-reject","errorCode":null,"errorMessage":"Refusing to persist rateLimitOverrides with rejected keys: ${result.rejected.join(\", \")}","messagePattern":"Refusing to persist rateLimitOverrides with rejected keys: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/db/providers.ts","lineNumber":686,"sourceCode":"  // to no-overrides) keeps the field present on the returned object so the\n  // UI can tell \"field was read, no overrides\" apart from \"field absent.\"\n  if (\"quotaWindowThresholds\" in connection) {\n    const result = sanitizeQuotaWindowThresholds(connection.quotaWindowThresholds);\n    if (result.rejected.length > 0) {\n      throw new Error(\n        `Refusing to persist quotaWindowThresholds with rejected keys: ${result.rejected.join(\", \")}`\n      );\n    }\n    connection.quotaWindowThresholds = result.sanitized;\n  }\n\n  // Same sanitization for rateLimitOverrides — keep in-memory representation\n  // in sync with what gets persisted. Reject (don't silently drop) invalid\n  // keys/values so a direct DB writer can't lose operator intent.\n  if (\"rateLimitOverrides\" in connection) {\n    const result = sanitizeRateLimitOverrides(connection.rateLimitOverrides);\n    if (result.rejected.length > 0) {\n      throw new Error(\n        `Refusing to persist rateLimitOverrides with rejected keys: ${result.rejected.join(\", \")}`\n      );\n    }\n    connection.rateLimitOverrides = result.sanitized;\n  }\n\n  _insertConnectionRow(db, encryptConnectionFields({ ...connection }));\n  const providerId = toStringOrNull(data.provider);\n  if (providerId) {\n    reorderConnections(db, providerId);\n  }\n  backupDbFile(\"pre-write\");\n  invalidateDbCache(\"connections\"); // Bust connections read cache\n\n  return withNullableRateLimitOverrides(\n    withNullableQuotaWindowThresholds(\n      withNullableMaxConcurrent(cleanNulls(connection), connection),\n      connection","sourceCodeStart":668,"sourceCodeEnd":704,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/db/providers.ts#L668-L704","documentation":"Error \"Refusing to persist rateLimitOverrides with rejected keys: ${result.rejected.join(\", \")}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/db/providers.ts:686 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"}