Skip to content

fix: enforce exact name match in get_collection#7084

Open
kailashv2 wants to merge 1 commit into
chroma-core:mainfrom
kailashv2:fix/get-collection-exact-name-match
Open

fix: enforce exact name match in get_collection#7084
kailashv2 wants to merge 1 commit into
chroma-core:mainfrom
kailashv2:fix/get-collection-exact-name-match

Conversation

@kailashv2
Copy link
Copy Markdown

@kailashv2 kailashv2 commented May 15, 2026

Summary

Fixes #7063

get_collection() was returning a collection even when the requested
name didn't exactly match. For example, querying colls would return
coll if it existed.

Root Cause

The sysdb query uses a partial/prefix match internally. The frontend
never verified that the returned collection's name exactly matched the
requested name.

Fix

Added an exact name check after fetching from sysdb:

  • If the returned collection name matches exactly → return it
  • If not → return NotFound error

Testing

  • Existing tests pass
  • Manual test: querying colls when only coll exists now returns 404

Fixes chroma-core#7063

get_collection() was returning a collection even when the requested
name didn't exactly match. The sysdb query uses a prefix/partial match
internally, so querying 'colls' would return 'coll' if it existed.

Added an exact name check after fetching: if the returned collection's
name doesn't match the requested name exactly, return NotFound instead.
@github-actions
Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Get Collection returns a collection although the name doesn't match

1 participant