Open luckman212 opened 1 month ago
In the meantime you can try Attachment MANAGER plugin in the meantime which can move attachments and you can use Attachment Name Formatting plugin to rename attachments (except if you are saving attachments into a subfolder in the attachments folder, then renaming attachments doesn't work).
@itoldusoandso Thank you but I did try that and it doesn't work for my vault which is already heavily organized with attachment subfolders.
I started debugging on my own because I don't know if @trganda is around much
I bisected the initializing functions in main.ts
until I found the one causing the huge delay. I then added a simple console log here
>>> console.log("in onLayoutReady!");
I see there's some crazy recursion going on, the func is called 6744 times when Obsidian starts! It feels like an Obsidian bug, since the plugin code hasn't changed, but I don't know if we can work around it somehow, or why onLayoutReady()
is being called so often.
Here's a perf graph captured during a long load
Zooming in at/near the moment when the file tree appears
all this is just 1000s of iterations to onLayoutReady()
I forked the repo and created a fix for this bug. I don't know if it's correct, but please check out https://github.com/luckman212/obsidian-attachment-management/commit/205362a46bdd778b580c7a2fa8424d1a17028132?diff=unified&w=1
So far it's working for me!
If anyone else wants to test:
https://github.com/luckman212/obsidian-attachment-management
reponpm i
followed by npm run build
main.js
, manifest.json
and styles.css
to your Obsidian plugins folder/obsidian-attachment-management (replacing the originals)Tks for @luckman212 working. I have no right to using Obsidian v1.6.0 at this time, since I'm not the VIP user (accessing early verison) of Obsidian.
I will checking your fix, and if everything ok I will add it to this repo.
Ah ok @trganda thank you. Hopefully they make 1.6 public soon.
I've been using the patched version for a couple of days now and it's working fine for me. I submitted my change as a pull request: #123.
I have merged PR and released a new version.
@trganda One small thing, I realize I left a debug message in that commit, you may want to remove it. It's here:
@trganda Just a quick note that 1.6.2 is now publicly available to all.
Tks for your tips, I will update and try to adapt the new version.
I am not sure why, but with Attachment Management enabled, the file explorer tree on the left appears completely blank for a long time after launch of Obsidian.
I tested this on 2 separate computers, both Obsidian 1.6.0, and with NO other extensions enabled.
This is what the UI looks like during that time
After some time, the file list appears. There is nothing additional shown in the Console (debug log).