Repository navigation
fix(sync): create user page only with its first created-by ref - #14097
Merged
Merged
Conversation
Non-uploaded transactions such as the graph-sync metadata write during download created the member's user page locally, so later uploads referenced a page the server never received. Fixes #14096.
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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
Fixes #14096: a graph member's first new block was rejected by db-sync with
Nothing found for entity id [:block/uuid <member user uuid>].add-created-by-ref-hookadded the user page (gen-created-by-block) to any pipeline tx while the page was missing locally, even when the tx referenced it nowhere. During download,set-graph-sync-metadata!transacts kv entries with{:persist-op? false}, so the member's user page was created in a tx that is never uploaded. Later local txs found the page viad/entity, emitted only[:db/add e :logseq.property/created-by-ref id], and the server rejected them.Now the user page is created in the same (uploaded) tx as its first
created-by-ref.The issue's other suggestion (adding
:sync-download-graph?tortc-tx-or-download-graph?) is not needed:transact-pipelinealready skipscompute-extra-tx-datafor:sync-download-graph?txs viaderive-extra-data?, so the hook never runs on the snapshot import itself.Graphs where the page was already created locally-only need a fresh download; after this fix the download no longer creates it.
Tests
frontend.worker.pipeline-test/user-page-is-created-only-by-a-tx-that-references-it-test: fails on master (page created by a:persist-op? falsekv tx; first block tx lacks the page datoms), passes with the fix.frontend.worker.pipeline-test,db-sync-test,sync.download-test,node-sync-test, reaction tests: 0 failures. clj-kondo clean.Link to Devin session: https://app.devin.ai/sessions/962ef90b853a4956a13511492839ecde
Open in Devin Desktop: https://app.devin.ai/desktop/session/962ef90b853a4956a13511492839ecde?variant=devin
Requested by: @tiensonqin
🟢 Devin Review found nothing to fix · View findings