Repository navigation
fix: skip tag template auto-insert on undo/redo replay - #13553
Merged
Merged
Conversation
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
There was a problem hiding this comment.
✅ Devin resolved the finding on b784b42
Fixed by Devin (1)
- Redo loses tagged block template children
1 task done
tiensonqin
force-pushed
the
devin/1790843491-template-redo-dup
branch
from
October 1, 2026 17:03
b784b42 to
1f3dff2
Compare
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
* fix: skip tag template auto-insert on undo/redo replay * fix: only skip tag template insert for verbatim tx-data replays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Redoing a tag-driven template auto-insert duplicated the template children.
When a block gains a tag listed in a template's
:logseq.property/template-applied-to,insert-tag-templatesincompute-extra-tx-datafires on the:block/tags :addeddatom. History replay has two paths inapply-history-action!:[:transact [tx-data nil]]fallback when no semantic outliner ops are recorded, e.g.:set-block-propertytagging): the replayed datoms already contain the pipeline-generated children, so re-runninginsert-tag-templatesinserts a second copy — the reported bug.:insert-blocksof a tagged block): replayed ops run on a temp conn where the pipeline is skipped (:skip-validate-db?), so the batch tx-data contains no children and the final transact's pipeline must fire to regenerate them.So the guard skips
insert-tag-templatesonly when the tx is a verbatim replay of recorded tx-data — marked via:db-sync/replayed-tx-data?inapply-history-action!(and the same[:transact]fallback inrebase-local-op!, which had the same latent duplication on RTC rebase).(:undo? tx-meta)is also skipped, matching every other pipeline side effect incompute-extra-tx-data; redoing ops still re-fires the pipeline so children are regenerated.Test coverage:
redo-tag-template-auto-insert-does-not-duplicate-test(fails without the fix: children count is 2 after redo) andredo-semantic-op-tag-template-auto-insert-test(covers the semantic-op replay path) infrontend.worker.undo-redo-test.Link to Devin session: https://app.devin.ai/sessions/13b8cda5422746018061c355f8ad3638
Open in Devin Desktop: https://app.devin.ai/desktop/session/13b8cda5422746018061c355f8ad3638?variant=devin
Requested by: @tiensonqin