Skip to content

fix: re-derive created-by-ref on outliner-ops redo - #13644

Open
megayu wants to merge 1 commit into
masterfrom
devin/1791452015-redo-created-by-derivation
Open

megayu wants to merge 1 commit into
masterfrom
devin/1791452015-redo-created-by-derivation

Conversation

@megayu

@megayu megayu commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Redo of a transaction that creates blocks via semantic outliner-ops lost the derived :logseq.property/created-by-ref attribute.

apply-history-action! replays history two ways: verbatim recorded tx-data (:db-sync/replayed-tx-data?), which already contains the derived attribute, and semantic outliner-ops replay, which contains only the submitted ops and needs compute-extra-tx-data to re-derive effects. add-created-by-ref-hook skipped on :redo?, covering both paths, so ops replay redid the block creation but not created-by-ref.

Guard on :db-sync/replayed-tx-data? instead — skip only on verbatim replay.

Test

redo-ops-replay-keeps-created-by-ref-test: inserting a block via insert-blocks derives created-by-ref from the id token; after undo+redo the attribute exists again (fails on master — nil after redo).

Same defect class as logseq/db-test#1387 (commands-tx, fixed in #13562).

Link to Devin session: https://app.devin.ai/sessions/a7c1b1acb1a647d5b05c319063b5aa7a
Open in Devin Desktop: https://app.devin.ai/desktop/session/a7c1b1acb1a647d5b05c319063b5aa7a?variant=devin
Requested by: @megayu

Creating blocks via outliner ops derives :logseq.property/created-by-ref
from the user's id token. Redo replaying semantic ops contains only the
user ops, so skipping the hook on :redo? lost the attribute. Verbatim
replay of recorded tx-data already contains it.

Guard on :db-sync/replayed-tx-data? (the verbatim replay marker) instead
of :redo?.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant