Fix vault fallback when Datacore returns no results#9
Open
NathanSkene wants to merge 1 commit into
Open
Conversation
Member
|
@NathanSkene Thank you for the contribution! A couple issues:
Is this problem reproducible? Stated differently, what are the criteria that result in Datacore being loaded but it's index being empty or stale? Also, is there a direct check we could do for this, rather than relying on just empty results? I would rather avoid running duplicate queries in the case of no results.
Would you be able to close this pull request and open a new pull request there? |
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
Problem
When Datacore is loaded but its index is empty or stale, its query API can return an empty array for discourse nodes that already exist in Obsidian's metadata cache. QueryEngine treated that as an authoritative empty result. The Discourse Context panel consequently showed no existing relationships, and the relation picker could not find compatible nodes.
This also bypassed the repository's documented Datacore-first-with-vault-fallback convention.
Validation
[]node --check main.jsgit diff --checkcontainsrelationships after reloadThe committed
main.jsbundle is updated alongside the TypeScript source so the fix is directly testable as an installed plugin.