Repository navigation
fix(outliner): undo property cardinality one-to-many - #13480
Closed
tiensonqin wants to merge 1 commit into
Closed
tiensonqin wants to merge 1 commit into
tiensonqin wants to merge 1 commit into
Conversation
Restore :db.cardinality/one and the single-value shape when undoing a toggle to multiple values. The upsert-property inverse now allows that safe many-to-one restore. Co-authored-by: Tienson Qin <[email protected]>
Contributor
Author
|
Shouldn't support reverting :many to :one. |
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.
Fixes logseq/db-test#1306
Undo of toggling a property from single to multiple values did nothing. The
:upsert-propertyinverse already restored the previous schema (:db/cardinality :db.cardinality/one), but applying that inverse threw "Disallowed many to one conversion" whenever any values existed. History replay then failed and cleared the undo stack.Change
:upsert-propertynow includes:allow-many-to-one? true.upsert-property!honors that option when every entity still has at most one value, so undo restores both cardinality and the single-value shape.Tests
frontend.worker.undo-redo-testfor the reported one-to-many undo/redo path, including poisoned raw tx so replay must use the semantic inverse.logseq.outliner.property-testcoverage for the restore option and the remaining many-to-one rejection cases.Lambda Bug tracking id: 28155