{"record":{"id":"ff7cb59803d4e07f","repo":"thedotmack/claude-mem","slug":"summary-watermark-bump-skipped-partial-write","errorCode":null,"errorMessage":"Summary watermark bump skipped — partial write","messagePattern":"Summary watermark bump skipped — partial write","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/sync/ChromaSync.ts","lineNumber":523,"sourceCode":"      notes: summary.notes,\n      prompt_number: promptNumber,\n      created_at_epoch: createdAtEpoch\n    };\n\n    const documents = this.formatSummaryDocs(stored);\n\n    logger.info('CHROMA_SYNC', 'Syncing summary', {\n      summaryId,\n      documentCount: documents.length,\n      project\n    });\n\n    // Only bump on a confirmed full write — see syncObservation() for rationale.\n    const written = await this.addDocuments(documents);\n    if (written === documents.length) {\n      ChromaSyncState.bump(project, 'summaries', summaryId);\n    } else {\n      logger.warn('CHROMA_SYNC', 'Summary watermark bump skipped — partial write', {\n        summaryId,\n        project,\n        requested: documents.length,\n        written\n      });\n    }\n  }\n\n  private formatUserPromptDoc(prompt: StoredUserPrompt): ChromaDocument {\n    return {\n      id: `prompt_${prompt.id}`,\n      document: prompt.prompt_text,\n      metadata: {\n        sqlite_id: prompt.id,\n        doc_type: 'user_prompt',\n        memory_session_id: prompt.memory_session_id,\n        project: prompt.project,\n        platform_source: prompt.platform_source,","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/services/sync/ChromaSync.ts#L505-L541","documentation":"syncSummary applies the same full-write rule as observations: the summaries watermark in ChromaSyncState is bumped only when addDocuments returns written === documents.length. A partial batch write skips the bump and logs this warning, leaving the summary queued for the next backfill pass.","triggerScenarios":"Some batches of a summary sync fail transiently inside addDocuments, returning written < requested.","commonSituations":"Chroma restart or overload mid-flush, embedder rate limiting, network drop.","solutions":["No manual action — the backfill on next boot retries the summary.","Restore Chroma health/connectivity so subsequent writes succeed fully.","Verify convergence afterwards rather than editing sync state."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"async function chromaHealthy(baseUrl: string): Promise<boolean> {\n  try {\n    const res = await fetch(`${baseUrl}/api/v2/heartbeat`, { signal: AbortSignal.timeout(2000) });\n    return res.ok;\n  } catch {\n    return false;\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only advance sync state on confirmed full writes.","Expect backfill to converge after transient Chroma outages; do not hand-edit sync state."],"tags":["chroma","sync","watermark","partial-write","idempotency"],"backgroundTag":"partial-write-retry","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}