CLI: a text property value set with `--update-properties` keeps `[[Page]]` as typed and gets no ref to the page

未关闭
#1,548 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
clojure
领域
backend, cli

调研方向

Start with create-property-text-block! in deps/outliner/src/logseq/outliner/property.cljs and compare its text property path with the CLI block content path through :logseq.outliner/save-block-input and :logseq.outliner/insert-blocks-input in deps/outliner/src/logseq/outliner/input.cljs. Reproduce with upsert block --update-properties and inspect the value block's title and :block/refs. Done means [[Page]] is stored as a resolved page reference with the matching ref, including when the property is set during block creation.

由索引模型根据 Issue 内容生成。

描述

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

Setting a :default (text) property with upsert block --update-properties '{:<property> "with [[Page]]"}' stores the value block's title exactly as given. The link stays [[Page]] instead of becoming [[<uuid>]], and the value block gets no :block/refs, so the block does not show up in that page's linked references. The same happens when the property is set in the same call that creates the block.

Saving the value block's content once more (upsert block --id <value block> --content '<same text>') resolves the link and adds the ref, which is my workaround.

Values entered in the desktop app do not have this problem: in my graph, every text property value with a link that was typed in the app has it stored as [[<uuid>]], with the ref.

Reproduce the Bug
G=demo                            # any DB graph
id() { jq '.data.result[0]'; }
logseq upsert page --graph $G --page link-target >/dev/null
logseq upsert page --graph $G --page link-repro >/dev/null
logseq upsert property --graph $G --name link-text --type default >/dev/null
P=$(logseq list property --graph $G | grep -o 'user.property/link-text-[^ ]*')
B=$(logseq upsert block --graph $G --target-page link-repro --content holder --output json | id)
logseq upsert block --graph $G --id $B --update-properties "{:$P \"with [[link-target]]\"}" >/dev/null
V=$(logseq query --graph $G --query "[:find ?v . :in \$ ?b :where [?b :$P ?v]]" --inputs "[$B]")
value() { logseq query --graph $G --query '[:find (pull ?v [:block/title {:block/refs [:block/title]}]) :in $ ?v]' --inputs "[$V]"; }
value
logseq upsert block --graph $G --id $V --content "with [[link-target]]" >/dev/null
value

Output, run on 18-11-2026:

[{:block/title "with [[link-target]]"}]
[{:block/refs [{:block/title "link-target"}] :block/title "with [[6afe0a1f-d59f-4ac8-b938-a1da2e744ebb]]"}]

The first line is the value as --update-properties stored it, the second the same value block after the re-save. The result is the same whether the CLI started the graph's db-worker or the desktop app owns it.

Expected Behavior

A text property value set through the CLI is stored the way the desktop app stores it: [[Page]] resolved to [[<uuid>]], and the page in the value block's :block/refs.

Screenshots

No response

Files

No response

Browser, Desktop or Mobile Platform Information

Linux, logseq --version: revision dad8e9c (nightly 20261118).

Additional Context

logseq/logseq#13998 made CLI block content go through the Desktop editor's parser (:logseq.outliner/save-block-input and :logseq.outliner/insert-blocks-input in deps/outliner/src/logseq/outliner/input.cljs). A text property value takes a different path: create-property-text-block! in deps/outliner/src/logseq/outliner/property.cljs puts the string into the value block's title as it is, so its links are never resolved.

Found with the help of an AI coding assistant driving the CLI.

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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

logseq/db-test 的其他 Issue

查看 logseq/db-test 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。