Skip to content

Fetch notes, tags and links from Joplin on plugin startup#1

Open
yugalkaushik wants to merge 2 commits into
masterfrom
dev
Open

Fetch notes, tags and links from Joplin on plugin startup#1
yugalkaushik wants to merge 2 commits into
masterfrom
dev

Conversation

@yugalkaushik
Copy link
Copy Markdown
Collaborator

Add functionality to fetch notes, tags, and extract links from note bodies when the Note Graph plugin starts.

Screenshot 2026-05-18 201251

Comment thread src/notesFetcher.ts Outdated
});

for (const note of response.items) {
const tags = await fetchTagsForNote(note.id);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /tags once
  • then call GET /tags/:id/notes per 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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for pointing this out. I’ll implement this approach and update the PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malekhavasi I have updated the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants