logseq icon indicating copy to clipboard operation
logseq copied to clipboard

Passing customUUID causes broken UI

Open tennox opened this issue 3 years ago • 2 comments

What happened?

My main use-case was to insert blocks with a UUID that matches my other DB, but when I use customUUID the block seems to be weird & non-selectable in some ways:

  • pressing arrow down while on the block above does not move the cursor into the block
  • (clicking into the block works fine)
  • right click on the bullet does nothing (no context menu)
  • pressing Esc doesn't select the block, like it would other blocks

Reproduce the Bug

console.log('result:',
  await logseq.Editor.insertBlock(
    (await logseq.Editor.getCurrentBlock()).uuid, 
    `Test 123`,
    { sibling: false, customUUID: '9ce207bf-e22d-4607-8140-3464a9256c8d' })
)

(the result has the correct UUID, but a Editor.getBlock with that UUID fails) (Also, after page refresh it seems to work)

Expected Behavior

A new block created that works like other ones.

Desktop Platform Information

Fedora 37, LogSeq 0.8.10 (AppImage)

Mobile Platform Information

No response

Additional Context

I'm saving block state and trying to re-create deleted ones it with the same UUID as before.

tennox avatar Nov 09 '22 17:11 tennox

Thought the workaround from https://github.com/logseq/logseq/issues/4141 might help - but sadly also happens when inserting with {properties: { id: uuid } }:

await logseq.Editor.insertBlock(
        currentBlock.uuid,
        content,
        { sibling: false/* , customUUID: uuid */, properties: { id: uuid } },
)

tennox avatar Nov 09 '22 17:11 tennox

we found the fix :tada: https://github.com/logseq/logseq/pull/7375

tennox avatar Nov 17 '22 12:11 tennox