Duplicates can be decided in a batch and filtered by type - #429
Merged
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First cut of #428, capability only; the review page follows.
What it adds
POST /kbs/{id}/review/batch—{ ids: [...], action: "merge" | "keep" }, Editor, 1–500 ids. Every id goes through the samedecide_reviewa single decision uses: same merge direction, same status anddecided_by, an audit row per success (with the batch size in its detail). One failure — an id that does not exist, a pair already decided, a merge that errors — does not stop the rest; the response lists each id with its error or none. An unknown action rejects the whole batch. The review stream is pushed once at the end.?types=on the duplicates queue —any(default),same(both sides typed and equal),conflict(both typed and different). A side with no type is in neither of the last two: not knowing is neither "same" nor "different".review::countsgainsduplicates_same_typeandduplicates_type_conflicton the same predicate, so the rail's numbers and the list agree by construction.Not done on purpose
No automatic merge of identical-name, same-type pairs (the issue's point 2). Same name and same type is not identity, and the base's rule stands: a namesake tie goes to a person. The filter plus the batch make that person's click one click.
Verified
crates/utopia-store/tests/a_batch_decides_like_a_person.rson a real database: four namesake pairs (two same-type, one type-conflict, one with an untyped side); the three filters return exactly the expected ids and the counts match them; a batch merge of two real ids and one ghost merges the two, reports the ghost, and leaves exactly one entity of each pair merged into the other with the decider recorded; deciding an already-decided pair reports an error; a batch keep clears the conflict pair and the counts follow.review_stagesstill passes with the new signature.cargo fmt,cargo clippy --all-targets -D warnings.🤖 Generated with Claude Code