The merge itself joins the entity history - #472
Merged
Merged
Conversation
Entity merges had a clock since #337 but no reader: opening an entity showed the facts a merge invalidated, never the merge. `entity_history` now carries merged_in / merged_away / merge_reverted, with the other entity by name and the revert attributed from the audit trail rather than borrowed from the merge row. Co-Authored-By: Claude Opus 5 <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.
Opening an entity showed the facts a merge had invalidated, never the merge.
entity_mergeshas had its own clock since #337 (created_at/reverted_at) and no reader on this axis, so the panel stated the consequence and left out the cause — the largest change of mind there is: from here on, this and another entity are the same thing.entity_historynow carries three more kinds:merged_in— another entity was merged into this one.merged_away— this one was merged into another; its id stops standing on its own.merge_reverted— the merge was undone.Two directions rather than one line, because absorbing and being absorbed are different things on the graph and the rollback is written per direction. The other entity comes back by name (LEFT JOIN, so a purged base still lists the event), and the revert is attributed from the audit trail (
merge.revert, target = the merge) instead of the merge row'smerged_by: the person who undoes a merge is usually not the one who made it, and an automatic merge has no one there at all. The paging total counts the new branch.crates/utopia-store/tests/history_shows_the_merge_itself.rsasserts direction, attribution and the total against a real database.🤖 Generated with Claude Code