-
Notifications
You must be signed in to change notification settings - Fork 82
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
Bug: Linter freezes Obsidian V1.4.5 on Fedora Silverblue 38 Flatpak #872
Comments
Hey @dougkeiller , could you provide a file that causes this issue? I am not sure if I can reproduce the issue with just the config. |
It looks like based on the video that it is hanging trying to lint a specific file. So it is likely not version specific, but I will need whatever file is causing the issue in order to be able to debug the issue since I am not currently able to reproduce this issue in my test vault. |
The Princeton Guide to Evolution.md I know this is a big file....the linting process is what freezes Obsidian |
Thanks for providing the file. My best guess as to what the problem is is that something is running into an infinite loop. Either that or the file is so large it is causing issues with one of the parsers. The latter is something I have little control over. But I will update the issue with info about the issue when I confirm it. |
@dougkeiller , I think I see what is going on, but I am not sure I can do a whole lot to prevent Obsidian from freezing up when trying to lint a file of this size. According to the debug logs the following seems to be the duration of the file being linted:
That comes out to about 506 seconds or about 9 minutes. I also wanted to know how long it took to parse the file without anything else being done. Each time the Linter parsed the text it took about 10 seconds. The Linter has to parse the file each time it tries to ignore something or run a rule that relies on the structure of the file. This happens quite a bit on a file. This adds up. In this case, that is where the Linter is spending most of its time in each rule. Most rules took 10 seconds or more to run with the parsing of the file text causing the slowdown. Unfortunately I cannot really speed up the parser itself, so something else would have to change to help keep Obsidian from seeming to freeze. I can show a warning on files larger than a certain size that asks if you want to lint the file knowing it could take more than 5 minutes to run and Obsidian will freeze up in the meantime. How does that sound? Can you think of any other alternatives? |
Here is the full set of logs minus the text after each rule ran:
Some rules could definitely benefit from performance boosts, but many of them are being constrained by the parser. Note to self, here are some rules that could take being looked at since they seem to be unperformant:
|
Many many thanks for your fast, thoughtful responses here! Obsidian just updated this package, and I successfully linted a smaller file without changing the setting :-) Although, I really appreciate you identifying which settings are bogging things down. I'll let you know if I run into trouble again in this thread (assuming same behavior). BTW, while Linter was slow, I looked for workarounds for my workflow, quite unsuccessfully, including a VSCode Linter that doesn't autocorrect (only provides errors) unlike the Obsidian Linter, which has awesome autocorrect on save/change. You guys have built a great plugin, super high value. A random idea is to add more specific use case packages like the VSCode Linter. The two I am most interested in are LanguageTool and proselint for my writing (I'm not coding). Didn't get them working yet, so not sure if they add something more than Vale, which is pretty amazing, but just to share a thought for the roadmap. LMK how I can support you guys in your efforts. Bravo! |
I believe that LanguageTool has its own plugin and proselint looks to be a python application. It would likely need to be its own plugin and be desktop only given the constraints. But those are interesting ideas. My speciality is more backend in terms of changes as opposed to things that show in the UI for users which has been a decent hold up for adding certain things. But it may be feasible to get something in place at some point for some of these things. |
This would be partially fixed by #337 since the Linter would not run on the main thread. It would allow for the file to get linted without freezing the screen. I will need to work on that at some point. |
Describe the Bug
When Linter "lints" a file, Obsidian freezes. Only way to unfreeze is to restart.
Disabling Linter prevents this from happening, so definitely narrowed to Linter as cause of freeze.
Rules
If you are not sure which rule(s) may cause the issue, please attach the
data.json
file located at<vault>/.obsidian/plugins/obsidian-linter/
or copy the config from the debug tab.Expected Behavior
Expected Obsidian to not freeze.
Screenshots
If applicable, add screenshots to help explain your problem.
Attached
(Freezes at end of the video...not sure why took so long...usually freezes almost immediately)
Screencast.from.2023-09-01.15-43-06.webm
Device
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: