Skip to content

Synced graph: text typed into a node added with "+ New" in a tag table is erased within a second (tx/reject, missing block) #1539

Closed
logseq/logseq
#14031

Description

@hdansou

Search first

  • I searched and no similar issues were found

What Happened?

On a synced graph, a node added with + New in a tag page's table cannot be given a name. The text I type is erased about one second after I stop typing, every time. The row stays in the table with an empty name.

On a local (non-synced) graph the same steps work and the text stays.

The worker log shows two errors. When the row is created:

[severe] [frontend.worker.db-listener] {:db-worker/post-commit-handler-failed
  {:stage :persist-local-tx, :outliner-op :insert-blocks,
   :error #error {:message "Non-transact outliner ops contain numeric entity ids",
     :data {:stage :forward-outliner-ops, :index 0,
       :op [:insert-blocks [[{:block/uuid #uuid "<new row>", :block/refs #{}, :block/tags [1213], :block/title "",
                              :block/parent [:block/uuid #uuid "<tag>"]}]
            #uuid "<tag>" {:sibling? false, :replace-empty-target? false, :keep-uuid? true, ...}]]}}}}

Then one of these for every pause in typing:

[severe] [frontend.worker.sync.handle-message] {:db-sync/tx-rejected
  {:message-type "tx/reject", :reason "db transact failed",
   :failed-tx-id #uuid "...", :missing-block-uuids [#uuid "<new row>"],
   :error-detail "#error {:message \"tx entry apply failed\", :data {:type :db-sync/tx-entry-failed, ...}}"}}

Reproduce the Bug

  1. Open a synced DB graph (mine has E2EE on) with sync connected.
  2. Create a tag, for example #Finance Ledger.
  3. Add tag properties: Date (date), Debit (number), Credit (number), and the built-in Description.
  4. Open the tag's page.
  5. In the table, click + New.
  6. Type a name for the new node, for example Rent payment, pausing between words.

Result: each word disappears about a second after it is typed. The row remains with an empty name.

Expected Behavior

The typed name stays, and the new node syncs to the server.

Screenshots

Files

No response

Browser, Desktop or Mobile Platform Information

macOS 27.2.1 (arm64), Logseq desktop app 2.0.2 nightly, revision 34eb0f6 (built 2026-11-17).

Additional Context

Investigation (at 34eb0f632e; the two files below are unchanged on master d608268212)

How it was reproduced: in a second instance of the installed desktop app on a test graph, with the input typed by automation and sync running on that instance's worker. Timeline of one run: "Rent " was shown in the row at 1.9 s, the editor held "ent " at 2.8 s and was empty at 3.5 s; each of the nine following words was erased within 0.7 s. The worker log has one tx/reject per word, all naming the new row's uuid in :missing-block-uuids.

  • Where the row is created: src/main/frontend/components/objects.cljs:18-25, add-new-class-object!, passes the tag as a numeric id: :properties (merge properties {:block/tags (:db/id class)}).
  • Why the insert is not queued for sync (confirmed from the log above): persist-local-tx! throws at assert-no-stale-numeric-ids! (deps/outliner/src/logseq/outliner/op/construct.cljc:1598-1608) because the forward op still holds :block/tags [1213]. The row exists locally, but its insert never enters the pending sync queue.
  • Why the id is not converted (suspected, from reading the code, not run in isolation): sanitize-ref-value (construct.cljc:88-95) checks (vector? v) first and treats the one-element vector [1213] as a single lookup ref, so the number inside is never turned into [:block/uuid ...].
  • Why the text disappears (confirmed from the log): later save-block transactions for the row are queued and uploaded. The server has never received the row, rejects each one with missing-block-uuids, and the client rolls the edit back.
  • Local graphs (confirmed): the post-commit-handler-failed error is logged there too, once per added row. Nothing is rejected, so the text stays.
  • Second effect (confirmed on another test graph): when a row was added while sync was not connected and sync was started afterwards, the next remote transaction failed to apply with :db-sync/apply-remote-txs-failed / DB write failed with invalid data (the new row reported as missing :block/parent and :block/page). Sync on that graph then stayed behind the server (local tx 436, remote 437, 10 pending).

Possibly related: #1430 ("Disappearing property text") shows text disappearing during property entry in a table; I have not checked whether it has the same cause.

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

  • I'm willing to submit a PR (Thank you!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions