{"record":{"id":"89f1c1915a9daddf","repo":"thedotmack/claude-mem","slug":"pull-res-status-await-res-text-catch","errorCode":null,"errorMessage":"pull ${res.status}: ${(await res.text().catch(() => \"\")).slice(0, 200)}","messagePattern":"pull (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workers/sync-hub/canary/canary.ts","lineNumber":261,"sourceCode":"\t\t\tacked: Array<{ operation_sha256: string; seq: string }>;\n\t\t\thead_seq: string;\n\t\t};\n\t\tconst ack = parsed.acked.find((a) => a.operation_sha256 === operationSha256);\n\t\tif (!ack) throw new Error(\"push response did not ack the canary op\");\n\t\treturn { seq: ack.seq, headSeq: parsed.head_seq, opSha: operationSha256 };\n\t}\n\n\tprivate async pull(\n\t\tdeviceId: string,\n\t\tsince: string,\n\t): Promise<{ ops: Array<{ seq: string; operation_sha256: string }>; headSeq: string }> {\n\t\tconst res = await fetch(`${this.args.hub}/v1/sync/changes?since=${since}&limit=500`, {\n\t\t\theaders: this.headers(deviceId),\n\t\t\tsignal: AbortSignal.timeout(this.args.timeoutMs),\n\t\t});\n\t\tthis.noteMode(res);\n\t\tif (!res.ok) {\n\t\t\tthrow new Error(`pull ${res.status}: ${(await res.text().catch(() => \"\")).slice(0, 200)}`);\n\t\t}\n\t\tconst parsed = (await res.json()) as {\n\t\t\tops: Array<{ seq: string; operation_sha256: string }>;\n\t\t\thead_seq: string;\n\t\t};\n\t\treturn { ops: parsed.ops, headSeq: parsed.head_seq };\n\t}\n\n\t/** Start both cursors at the current head — only NEW ops matter. */\n\tasync init(): Promise<void> {\n\t\tconst res = await fetch(`${this.args.hub}/v1/sync/status`, {\n\t\t\theaders: this.headers(DEVICE_A),\n\t\t\tsignal: AbortSignal.timeout(this.args.timeoutMs),\n\t\t});\n\t\tthis.noteMode(res);\n\t\tif (!res.ok) {\n\t\t\tthrow new Error(`status ${res.status}: ${(await res.text().catch(() => \"\")).slice(0, 200)}`);\n\t\t}","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/workers/sync-hub/canary/canary.ts#L243-L279","documentation":"Error \"pull ${res.status}: ${(await res.text().catch(() => \"\")).slice(0, 200)}\" thrown in thedotmack/claude-mem.","triggerScenarios":"Fires in the sync-hub canary when the pull endpoint returns a non-2xx status, e.g. hub downtime, auth failure, or a malformed since/head_seq cursor. Guard at workers/sync-hub/canary/canary.ts:261 fails the canary with a truncated body excerpt so monitoring catches pull-path breakage independent of push.","commonSituations":"See trigger scenarios.","solutions":["Inspect the status code and body in the message and fix the cause (auth, hub availability, or bad since cursor).","Verify the canary's hub URL and device credentials, then rerun."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}