chroma-core / chroma-core/chroma

[BUG] InsertOnConflictDoNothing returns wrong error on Create failure

Open
#6,889 0 comments 0 reactions 1 assignee Claimed by @sanketkedia View on GitHub
Dominant language
Rust
Stars
29.3k
Forks
2.5k
Avg merge
1d 4h
Merged PRs (30d)
38

Description

## Problem

In `collectionDb.InsertOnConflictDoNothing`, when GORM `Create` fails (`tx.Error != nil`), the code logged `zap.Error(err)` and returned `err`. The named return `err` is not assigned from the transaction in this path, so callers may receive `nil` or a stale value instead of the actual database error.

## Expected

Log and return `tx.Error` (the GORM error from the failed `Create`).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.