{"record":{"id":"01d49568147a7b72","repo":"thedotmack/claude-mem","slug":"push-res-status-await-res-text-catch","errorCode":null,"errorMessage":"push ${res.status}: ${(await res.text().catch(() => \"\")).slice(0, 200)}","messagePattern":"push (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workers/sync-hub/canary/canary.ts","lineNumber":240,"sourceCode":"\t\t\torigin_local_id: localId,\n\t\t\tpayload,\n\t\t\tpayload_schema_version: 2,\n\t\t\tpayload_sha256: await sha256Base64Url(canonicalJson(payload)),\n\t\t};\n\t\tconst body = canonicalJson(envelope);\n\t\tconst operationSha256 = await sha256Base64Url(body);\n\t\tconst res = await fetch(`${this.args.hub}/v1/sync/ops`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { ...this.headers(deviceId), \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprotocol_version: 2,\n\t\t\t\tops: [{ body, operation_sha256: operationSha256 }],\n\t\t\t}),\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(`push ${res.status}: ${(await res.text().catch(() => \"\")).slice(0, 200)}`);\n\t\t}\n\t\tconst parsed = (await res.json()) as {\n\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});","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/workers/sync-hub/canary/canary.ts#L222-L258","documentation":"Error \"push ${res.status}: ${(await res.text().catch(() => \"\")).slice(0, 200)}\" thrown in thedotmack/claude-mem.","triggerScenarios":"Fires in the sync-hub canary when the push endpoint returns a non-2xx status, e.g. the hub Worker is erroring, auth headers are rejected, or the request body violates a hub invariant. Guard at workers/sync-hub/canary/canary.ts:240 fails the canary loudly (with a truncated body excerpt) instead of reporting a healthy hub.","commonSituations":"See trigger scenarios.","solutions":["Inspect the status code and body in the message: auth failures mean bad hub credentials, 5xx means hub-side errors (check hub logs).","Verify the canary's hub URL and that the sync-hub deployment is healthy before rerunning the canary."],"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"}