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

Aperta
#1,548 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
clojure
Ambito
backend, cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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!)
Lingua principale
Nessun dato sulla lingua
Stelle
29
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di logseq/db-test

Tutte le issue di logseq/db-test

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.