{"record":{"id":"d1e50933729bee6b","repo":"diegosouzapw/OmniRoute","slug":"quotacache-refresh-failed-for-entry-connection","errorCode":null,"errorMessage":"[QuotaCache] Refresh failed for ${entry.connectionId.slice(0, 8)}:","messagePattern":"\\[QuotaCache\\] Refresh failed for (.+?):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/domain/quotaCache.ts","lineNumber":706,"sourceCode":"  refreshingSet.add(entry.connectionId);\n\n  try {\n    const connection = await getCachedProviderConnectionById(entry.connectionId);\n    if (!connection || connection.authType !== \"oauth\" || !connection.isActive) {\n      cache.delete(entry.connectionId);\n      return;\n    }\n\n    const proxyInfo = await resolveProxyForConnection(entry.connectionId);\n    const usage = await runWithProxyContext(proxyInfo?.proxy || null, () =>\n      getUsageForProvider(connection)\n    );\n\n    if (usage?.quotas) {\n      setQuotaCache(entry.connectionId, entry.provider, usage.quotas);\n    }\n  } catch (err) {\n    console.warn(\n      `[QuotaCache] Refresh failed for ${entry.connectionId.slice(0, 8)}:`,\n      (err as any)?.message || err\n    );\n  } finally {\n    refreshingSet.delete(entry.connectionId);\n  }\n}\n\nfunction needsRefresh(entry: QuotaCacheEntry, now: number): boolean {\n  const age = now - entry.fetchedAt;\n  if (entry.exhausted) {\n    if (entry.nextResetAt) {\n      const resetMs = parseDate(entry.nextResetAt);\n      if (resetMs !== null && resetMs <= now) return true;\n    }\n    return age >= EXHAUSTED_REFRESH_MS;\n  }\n  return age >= ACTIVE_TTL_MS;","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/domain/quotaCache.ts#L688-L724","documentation":"Error \"[QuotaCache] Refresh failed for ${entry.connectionId.slice(0, 8)}:\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/domain/quotaCache.ts:706 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"}