Fetch notes, tags and links from Joplin on plugin startup#1
Open
yugalkaushik wants to merge 2 commits into
Open
Fetch notes, tags and links from Joplin on plugin startup#1yugalkaushik wants to merge 2 commits into
yugalkaushik wants to merge 2 commits into
Conversation
malekhavasi
suggested changes
May 19, 2026
| }); | ||
|
|
||
| for (const note of response.items) { | ||
| const tags = await fetchTagsForNote(note.id); |
There was a problem hiding this comment.
One thing worth flagging here:
fetchTagsForNote is currently called inside the note loop, so it ends up doing one API call per note. For ~200 notes that means ~200 API calls just for tags, which could make the initial indexing quite slow on larger vaults.
Maybe a cleaner approach would be to flip it:
- call
GET /tagsonce - then call
GET /tags/:id/notesper tag - build a
noteId -> tags[]map upfront - then just do a lookup per note
That would reduce the number of calls a lot (for example ~200 down to ~13 for a vault with ~12 tags) and should scale much better
Collaborator
Author
There was a problem hiding this comment.
Got it, thanks for pointing this out. I’ll implement this approach and update the PR.
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.
Add functionality to fetch notes, tags, and extract links from note bodies when the Note Graph plugin starts.