{"record":{"id":"70dffea6b830101b","repo":"chroma-core/chroma","slug":"transactional-add-for-id-id-requires-a-prior","errorCode":null,"errorMessage":"transactional add for id \"${id}\" requires a prior read proving the id is absent","messagePattern":"transactional add for id \"(.+?)\" requires a prior read proving the id is absent","errorType":"validation","errorClass":"ChromaValueError","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/collection.ts","lineNumber":1719,"sourceCode":"          `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(\n        `transactional update for id \"${id}\" requires a prior read proving the id is present`,\n      );\n    }\n    if (operation === \"delete\" && !this.knownPresent.has(id)) {\n      throw new ChromaValueError(\n        `transactional delete for id \"${id}\" requires a prior read proving the id is present`,\n      );\n    }\n  }\n\n  private ensureOpen(): void {\n    if (this.closed) {\n      throw new ChromaValueError(\"conditional transaction is closed\");","sourceCodeStart":1701,"sourceCodeEnd":1737,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/collection.ts#L1701-L1737","documentation":"Error \"transactional add for id \"${id}\" requires a prior read proving the id is absent\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/chromadb/src/collection.ts:1719 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"}