Repository navigation
fix(vector_store): sync the facade mirror on backend update_vectors - #1847
Conversation
update_vectors returned straight from the backend delegate, leaving self.vectors and self.metadata stale, so save() persisted the pre-update values. Refresh the mirror for known ids, as delete_vectors already does on the backend path. Fixes semantica-agi#1833
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoKeep VectorStore’s mirror current after backend vector updates
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
If the backend update returned False it had kept its old values, but update_vectors still wrote the new ones into self.vectors and self.metadata, so a later save() persisted an update that never happened. Return the backend result before touching the mirror.
|
Finding 1 fixed in d6d369e: the mirror only changes when the backend reports success, with a test for a backend that returns False. 2 and 3 are about the SQL backends and save locking in general, outside this fix. |
|
Reviewed against #1833. One thing before this can merge: the head has no CI. On The branch is also behind main. Nothing else from me. |
Sameer6305
left a comment
There was a problem hiding this comment.
Approved. The fix correctly addresses #1833, the regression coverage is appropriate, focused tests pass, CI is green, and the remaining review findings were addressed/resolved. No merge-blocking correctness, security, compatibility, or concurrency issues found.
Description
On the backend path,
update_vectors()returned straight from the backend delegate and leftself.vectors/self.metadatastale, so a latersave()wrote the old vectors. It now refreshes the facade mirror for known ids, the same waydelete_vectors()already does.This PR was written with AI assistance (Claude Code). I reviewed and tested the change.
Type of Change
Related Issues
Fixes #1833
Changes Made
VectorStore.update_vectors: after delegating to the backend, update mirrored vectors and metadata under_inmemory_lock.test_update_vectors_syncs_backend_mirror_before_save.Testing
python -m build)Test Commands
The new test fails with the source change reverted.
Documentation
Breaking Changes
Breaking Changes: No
Checklist
Additional Notes
Ids not already in the mirror are left alone, matching the in-memory path.