You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Delete Jupyter checkpoints setting is enabled, checkpoints are put all together in one folder, in the plugin's directory. This folder is supposed to be deleted when Jupyter exits.
However, if the user closes Obsidian normally, the folder is never deleted. onunload is never called.
How to reproduce?
Open the test vault
Make sure Delete Jupyter checkpoints is enabled
Open Welcome.ipynb
Wait for some checkpoints to be created in .obsidian/plugins/jupyter/.ipynb_checkpoints
Close Obsidian using the top-right (Windows) cross
Checkpoints are still in .obsidian/plugins/jupyter/.ipynb_checkpoints
What have you tried?
Found out it was because onunload was never called on Obsidian exit, tried to find another hook but did not have any luck yet.
Additional information
Asked the question on Obsidian Forum, maybe some answer will come up there.
The text was updated successfully, but these errors were encountered:
With the received answer (thank you joethei), try to implement a solution and see if it works for a normal use case (of course, if the user kills the Obsidian process, the clean up logic probably won't be executed, but check that it is executed if the user simply closes Obsidian normally).
Register a Workspace.on('quit') event that stops the server and basically unloads the plugin
Check whether the cleanup is executed on Obsidian close, and whether there are times when it is not
Some best-effort cleanup has been implemented, but it cannot be certain that the plugin will be able to cleanup, as pointed out in joethei's answer, because some OS might kill Obsidian immediately and other weird shenanigans. Anyway, that's the best I can do.
What's the issue?
When the
Delete Jupyter checkpoints
setting is enabled, checkpoints are put all together in one folder, in the plugin's directory. This folder is supposed to be deleted when Jupyter exits.However, if the user closes Obsidian normally, the folder is never deleted.
onunload
is never called.How to reproduce?
Delete Jupyter checkpoints
is enabledWelcome.ipynb
.obsidian/plugins/jupyter/.ipynb_checkpoints
.obsidian/plugins/jupyter/.ipynb_checkpoints
What have you tried?
Found out it was because
onunload
was never called on Obsidian exit, tried to find another hook but did not have any luck yet.Additional information
Asked the question on Obsidian Forum, maybe some answer will come up there.
The text was updated successfully, but these errors were encountered: