You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Restoring a namespace child before its parent loses the parent #1350
Press Cmd+K (Ctrl+K), type "Foo/Bar", and create the page.
Delete the page Bar, then delete the page Foo.
Open the Recycle page. Restore Bar first, then Foo.
Expected
Foo/Bar is back as it was: Bar under Foo in the Library. Restoring Foo first and Bar second gives that.
Actual
Bar is back as a top-level page with no parent, and Foo is back without Bar under it.
Cause
restore-target (deps/outliner/src/logseq/outliner/recycle.cljs) keeps the original parent only when that parent is live and not in the Recycle; for a page whose parent is in the Recycle it returns no parent, and restore-tx-data retracts :block/parent. It also retracts :logseq.property.recycle/original-parent with the other recycle attributes, so when the parent comes back later nothing records that Bar belonged under it.
Found by the page model property test (frontend.worker.page-model-property-test, branch test/page-model-fuzz) on upstream master 16c4ed1a0, with the check "trash then restore is identity", run with a page and its namespace parent, restored in either order. Shortest sequence: FUZZ_REPLAY='[[:create 5 0 0] [:trash 0 3 1]]'. With [:trash 0 3 0] (the parent restored first) the graph comes back unchanged.
Activity