Repository navigation
perf: skip full-graph validate on MCP upsertNodes (#1265) - #13388
Merged
Merged
Conversation
tiensonqin
force-pushed
the
logseq/perf-upsert-nodes-validate-scope-ebc1
branch
from
September 23, 2026 07:59
45e1cbb to
ca948a2
Compare
tiensonqin
marked this pull request as ready for review
September 23, 2026 07:59
Contributor
|
Fixed in bc467fb: same-call page |
Validate only entities touched by the import tx for upsert-nodes. File and graph imports keep full-graph validate-local-db!. Co-authored-by: Tienson Qin <[email protected]>
Fail fast when a block page-id is a name instead of a page uuid or the id of a page added in the same call. Co-authored-by: Tienson Qin <[email protected]>
Assert validate-local-db! receives :entity-ids on the upsert-nodes import path instead of wrapping validate-import-txs. Co-authored-by: Tienson Qin <[email protected]>
tiensonqin
force-pushed
the
logseq/perf-upsert-nodes-validate-scope-ebc1
branch
from
September 23, 2026 08:26
bc467fb to
2587c87
Compare
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Sep 24, 2026
* perf: skip full-graph validate on MCP upsertNodes Validate only entities touched by the import tx for upsert-nodes. File and graph imports keep full-graph validate-local-db!. Co-authored-by: Tienson Qin <[email protected]> * fix: reject unresolved upsertNodes page-id Fail fast when a block page-id is a name instead of a page uuid or the id of a page added in the same call. Co-authored-by: Tienson Qin <[email protected]> * test: spy upsert-nodes scoped validation via entity-ids Assert validate-local-db! receives :entity-ids on the upsert-nodes import path instead of wrapping validate-import-txs. Co-authored-by: Tienson Qin <[email protected]> * fix: resolve upsertNodes page-id against same-call pages before existing page uuids --------- Co-authored-by: Cursor Agent <[email protected]>
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 1, 2026
* perf: skip full-graph validate on MCP upsertNodes Validate only entities touched by the import tx for upsert-nodes. File and graph imports keep full-graph validate-local-db!. Co-authored-by: Tienson Qin <[email protected]> * fix: reject unresolved upsertNodes page-id Fail fast when a block page-id is a name instead of a page uuid or the id of a page added in the same call. Co-authored-by: Tienson Qin <[email protected]> * test: spy upsert-nodes scoped validation via entity-ids Assert validate-local-db! receives :entity-ids on the upsert-nodes import path instead of wrapping validate-import-txs. Co-authored-by: Tienson Qin <[email protected]> * fix: resolve upsertNodes page-id against same-call pages before existing page uuids --------- Co-authored-by: Cursor Agent <[email protected]>
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 1, 2026
* perf: skip full-graph validate on MCP upsertNodes Validate only entities touched by the import tx for upsert-nodes. File and graph imports keep full-graph validate-local-db!. Co-authored-by: Tienson Qin <[email protected]> * fix: reject unresolved upsertNodes page-id Fail fast when a block page-id is a name instead of a page uuid or the id of a page added in the same call. Co-authored-by: Tienson Qin <[email protected]> * test: spy upsert-nodes scoped validation via entity-ids Assert validate-local-db! receives :entity-ids on the upsert-nodes import path instead of wrapping validate-import-txs. Co-authored-by: Tienson Qin <[email protected]> * fix: resolve upsertNodes page-id against same-call pages before existing page uuids --------- Co-authored-by: Cursor Agent <[email protected]>
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
* perf: skip full-graph validate on MCP upsertNodes Validate only entities touched by the import tx for upsert-nodes. File and graph imports keep full-graph validate-local-db!. Co-authored-by: Tienson Qin <[email protected]> * fix: reject unresolved upsertNodes page-id Fail fast when a block page-id is a name instead of a page uuid or the id of a page added in the same call. Co-authored-by: Tienson Qin <[email protected]> * test: spy upsert-nodes scoped validation via entity-ids Assert validate-local-db! receives :entity-ids on the upsert-nodes import path instead of wrapping validate-import-txs. Co-authored-by: Tienson Qin <[email protected]> * fix: resolve upsertNodes page-id against same-call pages before existing page uuids --------- Co-authored-by: Cursor Agent <[email protected]>
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
* perf: skip full-graph validate on MCP upsertNodes Validate only entities touched by the import tx for upsert-nodes. File and graph imports keep full-graph validate-local-db!. Co-authored-by: Tienson Qin <[email protected]> * fix: reject unresolved upsertNodes page-id Fail fast when a block page-id is a name instead of a page uuid or the id of a page added in the same call. Co-authored-by: Tienson Qin <[email protected]> * test: spy upsert-nodes scoped validation via entity-ids Assert validate-local-db! receives :entity-ids on the upsert-nodes import path instead of wrapping validate-import-txs. Co-authored-by: Tienson Qin <[email protected]> * fix: resolve upsertNodes page-id against same-call pages before existing page uuids --------- Co-authored-by: Cursor Agent <[email protected]>
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
* perf: skip full-graph validate on MCP upsertNodes Validate only entities touched by the import tx for upsert-nodes. File and graph imports keep full-graph validate-local-db!. Co-authored-by: Tienson Qin <[email protected]> * fix: reject unresolved upsertNodes page-id Fail fast when a block page-id is a name instead of a page uuid or the id of a page added in the same call. Co-authored-by: Tienson Qin <[email protected]> * test: spy upsert-nodes scoped validation via entity-ids Assert validate-local-db! receives :entity-ids on the upsert-nodes import path instead of wrapping validate-import-txs. Co-authored-by: Tienson Qin <[email protected]> * fix: resolve upsertNodes page-id against same-call pages before existing page uuids --------- Co-authored-by: Cursor Agent <[email protected]>
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 28, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 29, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 29, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 31, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 3, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 11, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 12, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 16, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 17, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 19, 2026
…ialog
Importing a one-page EDN through "Import EDN data" took about 11 seconds on a large graph.
The dialog called `batch-import-edn!` without a `:validate-scope`, so the import ran `validate-local-db!` over every entity of the graph. The MCP/CLI upsert path already passes `{:validate-scope :tx}` (logseq#13388) and the dialog was not changed with it.
The dialog now passes `{:validate-scope :tx}`, which validates the entities the import touched. The whole-graph EDN import keeps the full validation.
Test: `import-edn-data-dialog-validates-only-touched-entities-test` submits the dialog's EDN for a page with a tag and checks that `validate-local-db!` is called with `:entity-ids`.
The "Go to page" notification and the progress bar asked for in the issue are not part of this change.
Fixes logseq/db-test#994
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.
Fixes logseq/db-test#1265
Problem
MCP
upsertNodesimported through batch EDN and then ranvalidate-local-db!on every entity indb-after. On a large graph that made a single-block write take 60–140s whilelogseq-cli upsert blockstayed under a second.Change
validate-import-txsaccepts:validate-scope.:graph(default): keep full-graphvalidate-local-db!for file / graph /import-ednflows.:tx: validate only entities touched by the import tx (d/withtx-report eids).validate-local-db!accepts:entity-idsso scoped validation reuses the same error format and disallowed-key retry.upsert-nodespasses{:validate-scope :tx}automatically. No new MCP/API flag.Secondary
If a block
page-idis a page name instead of a uuid (or the:idof a page added in the same call),upsertNodesnow fails fast instead of reporting success and writing nothing.Tests
validate-import-txs:txdoes not invoke whole-db validation (spy + untouched invalid entity).:txstill rejects invalid import txs.:graphstill validates the whole DB.upsert-nodescallsvalidate-local-db!with:entity-ids(not the full graph).page-idnames are rejected.batch-import-edntests still pass.API / migration
No schema, protocol, or persisted-data migration. Existing
import-edn/ file import behavior is unchanged. MCP clients do not need to pass a new option.