{"record":{"id":"7f3778ff2a8447e8","repo":"jlcodes99/cockpit-tools","slug":"workbuddyautocheckin-7f3778","errorCode":null,"errorMessage":"[WorkbuddyAutoCheckin] 手动测试自动签到异常:","messagePattern":"\\[WorkbuddyAutoCheckin\\] 手动测试自动签到异常:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/codebuddy-suite/WorkbuddyAutoCheckinConfigModal.tsx","lineNumber":154,"sourceCode":"    setError(null);\n    try {\n      const result = await runWorkbuddyAutoCheckinCycleIfNeeded(true);\n      setLogs(await getWorkbuddyAutoCheckinLogsAsync());\n      setLogsError(null);\n      if (result === 'retry') {\n        setError(\n          t(\n            'workbuddy.checkin.manualTestPartialFailure',\n            '部分账号签到失败，请查看记录；后台稍后会自动重试。',\n          ),\n        );\n      } else if (result === 'waiting') {\n        setError(\n          t('workbuddy.checkin.manualTestAlreadyRunning', '自动签到任务正在执行，请稍后查看记录。'),\n        );\n      }\n    } catch (err) {\n      console.warn('[WorkbuddyAutoCheckin] 手动测试自动签到异常:', err);\n      const message = err instanceof Error ? err.message : String(err);\n      setError(\n        t('workbuddy.checkin.manualTestFailed', '测试执行失败：{{message}}', { message }),\n      );\n    } finally {\n      setManualTesting(false);\n    }\n  };\n\n  const handleClearLogs = async () => {\n    setError(null);\n    try {\n      await clearWorkbuddyAutoCheckinLogs();\n      setLogs([]);\n    } catch (err) {\n      const message = err instanceof Error ? err.message : String(err);\n      setError(\n        t('workbuddy.checkin.clearLogsFailed', '清空签到记录失败：{{message}}', { message }),","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/src/components/codebuddy-suite/WorkbuddyAutoCheckinConfigModal.tsx#L136-L172","documentation":"`handleManualTest` invokes the backend to run a manual auto-checkin test. Any rejection from that call is caught, logged with this message, and surfaced to the user via `setError` with a localized '测试执行失败' message. The `waiting` result means a test is already running and is not an exception.","triggerScenarios":"The manual-test backend call throws: check-in automation fails (login expired, target site unreachable), the task scheduler rejects a duplicate run, or configuration is invalid/missing credentials.","commonSituations":"Expired saved credentials for the workbuddy account; network/proxy blocking the check-in target; clicking manual test while a scheduled run is in flight (returns 'waiting', not an error); malformed check-in config after an update.","solutions":["Read the `message` shown in the error banner — it carries the backend's underlying failure reason.","Re-authenticate the workbuddy account so stored credentials/cookies are fresh.","Check network connectivity/proxy settings to the check-in target host.","Wait for the currently running task to finish if the result was 'waiting', then retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const config = await getWorkbuddyAutoCheckinConfig();\nif (!config?.credentials) setError('请先配置签到账号凭据');","typeGuard":"function isManualTestResult(v: unknown): v is 'done' | 'waiting' | 'failed' {\n  return v === 'done' || v === 'waiting' || v === 'failed';\n}","tryCatchPattern":"try {\n  const result = await runManualAutoCheckin();\n  // handle 'waiting' separately — not an error\n} catch (err) {\n  const message = err instanceof Error ? err.message : String(err);\n  setError(t('workbuddy.checkin.manualTestFailed', '测试执行失败：{{message}}', { message }));\n} finally {\n  setManualTesting(false);\n}","preventionTips":["Validate credentials/config exist before starting a manual test","Disable the manual-test button while a run is in flight to avoid duplicate-run rejections","Always reset manualTesting in a finally block","Surface err.message to the user rather than swallowing it"],"tags":["automation","backend","network","ui-feedback"],"backgroundTag":"automation-task-execution-failed","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"}