{"record":{"id":"339a30ba2d894ba2","repo":"chroma-core/chroma","slug":"transaction-already-has-a-buffered-write-for-id","errorCode":null,"errorMessage":"transaction already has a buffered write for id \"${id}\"","messagePattern":"transaction already has a buffered write for id \"(.+?)\"","errorType":"validation","errorClass":"ChromaValueError","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/collection.ts","lineNumber":1706,"sourceCode":"      operation,\n      payload,\n    } as ConditionalTransactionOperationPayload);\n  }\n\n  private validateBufferedWrite(\n    operation: ConditionalTransactionOperationPayload[\"operation\"],\n    ids: string[],\n  ): void {\n    const callIds = new Set<string>();\n    for (const id of ids) {\n      if (callIds.has(id)) {\n        throw new ChromaValueError(\n          `transactional write request contains duplicate id \"${id}\"`,\n        );\n      }\n      callIds.add(id);\n      if (this.bufferedWriteIds.has(id)) {\n        throw new ChromaValueError(\n          `transaction already has a buffered write for id \"${id}\"`,\n        );\n      }\n      this.validateWritePrecondition(operation, id);\n    }\n  }\n\n  private validateWritePrecondition(\n    operation: ConditionalTransactionOperationPayload[\"operation\"],\n    id: string,\n  ): void {\n    if (operation === \"add\" && !this.knownAbsent.has(id)) {\n      throw new ChromaValueError(\n        `transactional add for id \"${id}\" requires a prior read proving the id is absent`,\n      );\n    }\n    if (operation === \"update\" && !this.knownPresent.has(id)) {\n      throw new ChromaValueError(","sourceCodeStart":1688,"sourceCodeEnd":1724,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/collection.ts#L1688-L1724","documentation":"Error \"transaction already has a buffered write for id \"${id}\"\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/chromadb/src/collection.ts:1706 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}