Fix: Preserve root node block refs when cutting + pasting.#10841
Fix: Preserve root node block refs when cutting + pasting.#10841andelf merged 2 commits intologseq:masterfrom
Conversation
|
Sorry. I cannot reproduce the original bug. Screen.Recording.2024-01-11.at.4.03.13.PM.movThe above is my steps to reproduce the behavior. Am I missing something? |
|
Thanks for taking a look! Screen.Recording.2024-01-11.at.10.21.43.mov |
|
Here are some details on the other problem: Screen.Recording.2024-01-14.at.11.49.513.movAfter the cut the |
|
Thanks. It would probably be also good to address the problem of the stale I found the problem with the references to old For example there is |
|
I updated the PR to not include references to non-existing Let me know if this solution works. I don't have a good enough overview of the code base to know whether this would break something else. If there's another test case I should try also let me know. |
|
Here's the behavior after the changes:
Screen.Recording.2024-01-18.at.08.31.28420.mov |
|
Should we merge this or is there anything else missing? |
This is an attempt at a fix. There may be a better way to do this. When cutting + pasting the root node's references are not preserved. The problem is that the root-block returned by
db/pullmisses the:block/_refswhile blocks returned bydb/get-block-and-childrencontain:block/_refs. I know too little about the inner workings for Logseq and Datascript to know if this is expected. If someone could let me know whether or not this is expected or whether there is a way to modifydb/pullto return:block/_refsthat would be great.More details can be found in this issue: #4491