{"record":{"id":"b4cfbf6594b11b62","repo":"jlcodes99/cockpit-tools","slug":"accounts-groups-error-notfound","errorCode":"accounts.groups.error.notFound","errorMessage":"分组不存在","messagePattern":"分组不存在","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/CodexAccountGroupModal.tsx","lineNumber":163,"sourceCode":"\n  const applyQuotaMinutes = async (\n    group: CodexAccountGroup,\n    minutes: CodexGroupQuotaAutoRefreshMinutes,\n  ) => {\n    const next = normalizeCodexGroupQuotaAutoRefreshMinutes(minutes);\n    setError(null);\n    setQuotaBusyId(group.id);\n    try {\n      setGroups((prev) =>\n        prev.map((item) =>\n          item.id === group.id\n            ? { ...item, quotaAutoRefreshMinutes: next }\n            : item,\n        ),\n      );\n      const updated = await setCodexGroupQuotaAutoRefreshMinutes(group.id, next);\n      if (!updated) {\n        throw new Error(t('accounts.groups.error.notFound', '分组不存在'));\n      }\n      setQuotaCustomModeId(null);\n      await onGroupsChanged();\n    } catch (err) {\n      console.error('Failed to update codex group quota refresh:', err);\n      await reload();\n      setError(t('accounts.groups.error.quotaRefreshFailed', {\n        error: String(err),\n        defaultValue: '更新额度刷新设置失败: {{error}}',\n      }));\n    } finally {\n      setQuotaBusyId(null);\n    }\n  };\n\n  const handleQuotaSelectChange = (\n    group: CodexAccountGroup,\n    value: string,","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/src/components/CodexAccountGroupModal.tsx#L145-L181","documentation":"Guard in CodexAccountGroupModal.applyQuotaMinutes: after optimistically updating local group state, setCodexGroupQuotaAutoRefreshMinutes returned null/undefined, meaning the backend no longer has a group with that id (deleted elsewhere or stale local copy). The modal surfaces the i18n message accounts.groups.error.notFound ('分组不存在').","triggerScenarios":"Thrown at src/components/CodexAccountGroupModal.tsx:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the group list so the deleted group disappears from the modal","Recreate the group if its removal was unintended, then reapply the quota setting","Avoid concurrent deletion while the quota editor is open"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1ed8b77992d62ca81fabf744deb0839ad361d5bf","analyzedAt":"2026-09-05T09:51:41.178Z","contentChangedAt":"2026-09-05T09:51:41.178Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}