logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
30.7k stars 1.78k forks source link

Data loss upon opening logseq: externally added content to today's journal #11327

Open lboklin opened 1 month ago

lboklin commented 1 month ago

Search first

What Happened?

Unless logseq has the most recent version of today's journal document cached, it will implicitly erase the content of whichever block is automatically selected when the application starts.

Reproduce the Bug

Firstly, I don't know how or if at all the official cloud sync service makes any difference. I use syncthing to keep my files synced between devices, and this affects me all the time.

Prerequisites:

  1. you of course need to have the journal feature enabled so that logseq opens to it by default
  2. the document file for today's journal entry must have more blocks than when your logseq application last saw it.

Then:

  1. close logseq if open
  2. add some new blocks to today's journal document through some external application
  3. open logseq
  4. you should now observe the contents of one of the newly added blocks never appearing because you are in edit mode of an empty block, and the text field does not update.

Expected Behavior

Opening logseq should either

  1. wait with going into edit mode until the document has been re-indexed, OR
  2. the empty block the cursor is in should be considered unique and appended to any other, newly indexed blocks.

I personally think (2) makes the most sense.

Screenshots

No response

Desktop or Mobile Platform Information

App Version: 0.10.9 Git Revision: c67b8b5 Platform: Mozilla/5.0 (X11 Linux x86_64) AppleWebKit/537.36 (KHTML like Gecko) Logseq/0.10.9 Chrome/118.0.5993.159 Electron/27.3.11 Safari/537.36 Language: en-GB Plugins: logseq-summarizer (0.0.4), logseq-move-block (v1.0.0), logseq-journals-calendar (v0.10.10), ollama-logseq (v1.1.3), logseq-markdown-table (v1.8.0), logseq-bullet-threading (v1.1.4), logseq-flow-nord-theme (v0.10.38), logseq-bonofix-theme (v3.10.4), logseq-block-to-page (v1.3.0), logseq-emoji-picker-fork (v0.0.6), logseq-link-preview (v2.3.0), logseq-tags (v0.1.2), logseq-graph-analysis (0.12.0), logseq-mark-map (v0.4.3)

Additional Context

No response

Are you willing to submit a PR? If you know how to fix the bug.

MarSik commented 1 month ago

I am seeing the same behavior. My second computer lost the first entry from each day this way.

e-zz commented 3 weeks ago

This is common when you have two different devices running Logseq all the day. Logseq automatically jumps to the next day's jornal page when the day changes, and enter editing mode in the first block. So if you have one remote device also running Logseq, basically it means you have a remote client always editing the first block. That's why it happens.

One workaround is to close Logseq on your machine when you leave it. Another is when you come back to the remote machine, which is editing the first block, press Esc to exit editing mode without editing. Then it should be fine.

But I still hope Logseq devs can provide a way to turn it off. This behavior is indeed sometimes annoying.