DB Sync: journal page created on two devices, top-level blocks silently emptied on merge

オープン
#1,533 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
8/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
clojure, ios, linux, macos, sqlite

調査の方向性

The report is a sync merge bug in the E2EE graph with no reproduction, so there is no single file to start from. Read the sync and merge path that handles top-level block ordering and created-at on reconnect, and check related issues #779, #780 and #781 for the stalled-sync context. Done would mean a reproducible test where concurrent edits to one journal page keep both sides or raise a conflict, instead of emptying blocks.

索引モデルが issue の本文から書いたものです。

説明

Search first
  • I searched and no similar issues were found
What Happened?

E2EE graph synced between Desktop (macOS), iOS and a read-only CLI client (Linux).

  1. Overnight, during a macOS maintenance wake with nobody at the computer, Desktop created today's journal page together with an empty first block (same millisecond). logseq/logseq#11913 was meant to avoid creating that block before the user edits it.
  2. In the morning, Desktop edits on that page (top-level blocks with children) did not reach the server for ~3 h, with no visible error (see #780).
  3. On iOS, I pasted an image into the first, empty block of that page.
  4. I restarted Desktop to force sync.

Result, now the same on all devices:

  • all top-level blocks are empty, including a task and a parent block that had text; nested blocks kept their text;
  • Desktop's blocks kept their UUIDs but got a new :block/created-at (merge time), and the top-level ones were moved before the first block (Zy, Zz... < a0);
  • the task title was emptied without bumping :block/updated-at;
  • the image ended up in Desktop's empty first block from step 1.

No conflict prompt, nothing in Recycle, graph validate finds no errors. iOS and Desktop showed different versions for a while, then converged.

Reproduce the Bug

Not reproduced yet. Likely path: two devices share today's journal; device A edits it while its sync is silently stalled (#779, #780); device B edits the first block; device A reconnects.

Expected Behavior

Keep both sides' changes, or show a conflict. Never empty blocks silently.

Screenshots

No response

Files

No response

Browser, Desktop or Mobile Platform Information

Desktop 2.0.2 (macOS arm64), iOS 2.0.2 (54) TestFlight, CLI rev 533ac43 (Linux). E2EE on.

Additional Context

Related: #781 (data loss with pending changes on 2 devices), logseq/logseq#13036 (journal children lost on rebase).

Are you willing to submit a PR? If you know how to fix the bug.
  • I'm willing to submit a PR (Thank you!)
主要言語
言語のデータがありません
スター
29
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

logseq/db-test のほかの issue

logseq/db-test の issue をすべて見る

似ている issue

Data Engineering の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。