An edit is lost when the page reloads right after Escape
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- sqlite
- 領域
- database
調査の方向性
Start by tracing the editor save path through the async steps that build outliner ops and post apply-outliner-ops, then inspect how the worker acknowledges the sqlite transaction. Reproduce with the described Escape and reload timings; done means an edit survives reload during the reported window. The issue lists several possible designs and leaves the choice to maintainers.
索引モデルが issue の本文から書いたものです。
説明
An edit is lost when the page reloads right after Escape
Type in a block, press Escape, and reload within about 150 ms: the edit is gone after the reload (no block in the database holds it). At 500 ms it is kept. On an idle machine the window is short; on a loaded one it is wide enough to hit by hand.
Found by a local key fuzzer that types a unique token into the focused block editor, presses Escape twice, waits 0, 150 or 500 ms, reloads, and then queries the database for the token (logseq.api.datascript_query): 7 of 118 such checks lost the token, all at 0 or 150 ms, none at 500 ms, with varied preceding steps. A fresh page on an idle machine kept the edit 24 of 24 times.
Where the edit is lost
The worker writes a transaction to sqlite synchronously once it has it, so the loss is between Escape and the save reaching the worker: the save builds its outliner ops through several async steps before apply-outliner-ops posts them, and a reload in that time drops them. Nothing in the web app holds or flushes a pending save on unload: there is no beforeunload or pagehide handler for it.
Possible directions
- On
pagehide, post whatever the editor still holds synchronously (the save would need a synchronous path for that). - While a save is in flight, set a
beforeunloadhandler so the browser asks before leaving (and the desktop app waits for it before closing the window). - Keep the editor's content somewhere that survives the reload (session storage) until the worker has acknowledged the save, and replay it on start.
Each changes how saving works, so this is a question for the maintainers rather than a patch.
- 主要言語
- 言語のデータがありません
- スター
- 29
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
logseq/db-test のほかの issue
-
Web build on a phone: the fold arrow of an h1/h2 block lies on its bullet, so tapping the bullet folds instead of zooming in対応中かも @tiensonqin が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
Page titles with `$$`, `$&`, `` $` `` or `$'` change when block refs are resolved対応中かも @RaphaelFakhri が 19 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
`#Asset` label is not displayed on asset nodes when `Hide from Node` is disabled対応中かも @tiensonqin が 22 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
jasonacox/pypowerwall#472 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
surrealdb/surrealdb.py#439 ·
メンテナーはふだん 6 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
mattgodbolt/zindex#67 ·
メンテナーはふだん 1 日以内に返信
-
Add: Hindi Hits Logoオープンcheck:passed logos:add
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信