Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird cache and indexing vault #18

Open
Mara-Li opened this issue Dec 1, 2022 · 9 comments
Open

Weird cache and indexing vault #18

Mara-Li opened this issue Dec 1, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@Mara-Li
Copy link

Mara-Li commented Dec 1, 2022

Hello ;

On my vault, the plugin will add a big loading time during the cache reading.
After this, Obsidian will ALWAYS reindex the vault.

This bug appear on Mobile and PC, vault is sync using Obsidian Sync.

I tryed with every plugin disabled, keeping only frontmatter links, and the issue persist.
Note : My vault contains around 300 notes, with PDF, image, js files...

SYSTEM INFO:
Obsidian version: v1.0.3
Installer version: v1.0.3
Operating system: Windows 10 Education 10.0.22623
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: light
Community theme: AnuPpuccin
Snippets enabled: 31
Restricted mode: off
Plugins installed: 87
Plugins enabled: 3
1: Banners v1.3.3
2: Divide & Conquer v1.0.0
3: Frontmatter Links v1.2.6

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

@peterkehlerjr
Copy link

I've been experiencing the same issue for a couple of days now. Took me a while to narrow it down to this plugin.
It's a nice plug-in and I'm ooking forward to use it again after a fix.

@Trikzon
Copy link
Owner

Trikzon commented Dec 1, 2022

In order to add frontmatter links to the graph, I process each note to see whether it has any links in the frontmatter when a note is reindexed.

I have never experienced performance problems with this, however, after my finals next week I can look into making this better performant.

The only times that the entire vault is told to reindex by this plugin is when it is enabled, when the "Add to graph" setting is toggled, and when a file is renamed and "Automatically update frontmatter internal links" is set to true.

I'm not sure its necessary anymore when a file is renamed, so I'll look into removing that after my finals, but once again, I never experienced lag from this so I assumed it was fine.

For now, if you'd like to use the rest of the features, I recommend that you disable the "Add to Graph" and "Automatically update frontmatter internal links" settings until it is fixed.

@Trikzon Trikzon added the bug Something isn't working label Dec 1, 2022
@Mara-Li
Copy link
Author

Mara-Li commented Dec 1, 2022

I think it can be caused by syncing. Dunno how or why.

Good lucks for your exam !

@tobiasvl
Copy link

tobiasvl commented Dec 3, 2022

I use Obsidian Sync and I've also experienced reindexing of the cache every time I launched Obsidian, although I haven't suspected this plugin until now.

@ArtemisFowl-san
Copy link

I've had the same problem for a couple of days. Really like the plug in and hope this can be fixed :) Thanks for your efforts in any case

@mktwohy
Copy link

mktwohy commented Jan 5, 2023

I also use Obsidian Sync and have narrowed down the issue to this plugin. Every time the app loads, Obsidian re-indexes

@svenluijten
Copy link

svenluijten commented Jan 22, 2023

This also happens when syncing via iCloud, not just Obsidian Sync. Every time I open the mobile app (iOS and iPadOS) with this plugin enabled, it shows me that Obsidian is re-indexing the entire vault.

While this doesn't cause me any lag, it is mildly annoying.

image

Disabling the "Add to graph" config option solves the issue for now 😀

@elzik
Copy link

elzik commented Jun 14, 2023

I have same issue with this plugin and can also confirm that disabling the "Add to graph" config option is a workaround.

@pvojtechovsky
Copy link

@Trikzon today I debugged the obsidian code around parsing of markdown and creating/updating of metadataCache.
I found that you modify metadataCache records after its copy is saved in IDBDatabase. It causes inconsitency between memory content of the metadataCache and it's persistent copy in IDBDatabase.

There is a chance that this inconsistency causes need for reparsing of markdown files and long startup times.

May be the solution would be to not listen on metadataCache change but directly hook on metadataCache.saveMetaCache(...) method. If you modify the cache (add links from frontmatter) before the origin implementation is called, then the memory and IDBDatabase will be consistent and you do not need to search for links in frontmatter with each start of obsidian, because it will be loaded from IDBDatabase correctly.

Are you going to try it? What next steps do would you suggest/like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants