FlorianWoelki / obsidian-iconize

Simply add icons to anything you want in Obsidian.
https://florianwoelki.github.io/obsidian-iconize/
MIT License
890 stars 62 forks source link

Icons keep getting deleted (on restart) #324

Closed melMass closed 10 months ago

melMass commented 11 months ago

Describe the bug Every time I restart obsidian it wipes most but not all the icons in .obsidian/icons. Kind of related but custom icon packs have a similar issue where the icon file is only copied on first use of the icon. So if I only use one icon from a custom pack and restart obs, only that icon is kept in the custom pack (length == 1)... For non custom packs it doesn't seem to follow the same behaviour as it also wipes ones being used.

Additional context Tell me what you need, not sure what could help debug it, but browsing the issues it seems to happen to a few others (#318 #313 #224)

Edit: I mostly use git as my sync mechanism (backed up on a few cloud providers too)

byjokese commented 10 months ago

The same happens to me, even the plugin options disappear, it installed and on the config files appears, but no options and no icons. Is getting hard to manually add all icons again and again and again.

EDIT: Not sure if is related, but may be some incompatibility with the make.md plugin? The second I uninstalled make.md it worked again, and as I had git as backup, I could recover .obsidian\plugins\obsidian-icon-folder\data.json, with all the previous icons.

EDIT 2: Even though I'm not losing all icons, I'm still losing some as @melMass says, without restarting the application, just by typing, there's a moment it just disappears, and in git I can see that the line defining the icon is deleted. On git, I can also see that some icons for no reason get deleted...

Detluff commented 10 months ago

Yes, there is definitely an incompatibility with makemd. I also lost icons after installing makemd, I moved the folder with icons again, tried to add by folder name, but it says that this folder already exists. I tried uninstalling and reinstalling Iconize, but after that I was unable to access the plugin settings (lol).

byjokese commented 10 months ago

Exactly, but even with that incompatibility, something else is wrong, because after uninstalling make.md it still does remove and loses icons after git synchronization or other process.

simonfossom commented 10 months ago

I have the same problem. It's not other plugins. I tested on clean vault.

FlorianWoelki commented 10 months ago

Custom icon packs are work in progress (so it's not done and not 100% functional). Syncing shouldn't be a problem because you have multiple options to prevent syncing issues for icons which are applied to files/folder (e.g., background check).

Furthermore, it is not really optimal to sync with git because the files for the icon packs can be really huge. I think there is not much that I can do, so I'll close this issue for now.

melMass commented 10 months ago

@FlorianWoelki sorry but how is icon deleting themselves on their own not considered a bug?

FlorianWoelki commented 10 months ago

@FlorianWoelki sorry but how is icon deleting themselves on their own not considered a bug?

Well, the issue is not with the plugin itself, but more like with the overall files you download and apply. I cannot limit any of these. I did my very best to fix this issue with background checks (which you can enable) and so on.

byjokese commented 10 months ago

@FlorianWoelki What do you refer with overall files you download and apply?, just to understand the issue. @simonfossom did report that this happens with a clean vault.

simonfossom commented 10 months ago

how i understand plugin works is that if user adds an icon in the plugin settings, it gets registered and added to the folder. what now happens is that registered icons get deleted from icons folder and deregisted. so to solve the issue icons shouod not be deleted.

that being said, it might be that I do not now something about how the plugin works.

FlorianWoelki commented 10 months ago

The icons are extracted from a zip file which is the icon pack. This file will then be saved in your Vault. Iconize never removes any icons automatically.

simonfossom commented 10 months ago

This is odd. Zip files disappear soon after adding icon pack and icons that I add (not from the repo) never get zipped.

Here's a proposal, but you're the best person to judge if it would make sense.

This would mean that you could remove add icon and add iconpack functionalities and just add open folder and instructions.

Do you think this could be possible solution? And why?

byjokese commented 10 months ago

I don't care about icons deleting as long as they get downloaded again, the main problem is losing the icon associated with each file and folder. It is not usable at all if each time you edit a file, the association gets lost.

melMass commented 10 months ago

I think Florian cannot reproduce our bug from what I understand but I have the same issue, not sure if there are logs that could help

FlorianWoelki commented 10 months ago

I think Florian cannot reproduce our bug from what I understand but I have the same issue, not sure if there are logs that could help

Exactly, I cannot reproduce it at all. However, you can still enable the background check in the settings. This will always check if all the icons are correctly downloaded.

byjokese commented 10 months ago

Yes, I got that enabled, but I'm losing the data from .obsidian\plugins\obsidian-icon-folder\data.json.

Open Obsidian, type something on a note:

The only other plugin also enabled is obsidian git. Trying to find the exact reason that happens with an new vault and similar conditions

FlorianWoelki commented 10 months ago

Yes, I got that enabled, but I'm losing the data from .obsidian\plugins\obsidian-icon-folder\data.json.

Open Obsidian, type something on a note:

  • Icon gets deleted.
  • Icon gets de-associated with the file on the data.json

The only other plugin also enabled is obsidian git. Trying to find the exact reason that happens with an new vault and similar conditions

So it's not related to files/folders? It's only related to icons in notes? If so, this is not implemented yet. I've created a separate issue for that #344

melMass commented 10 months ago

So it's not related to files/folders?

You are right I did not notice that!! It's only affecting in-note icons. I'll keep an eye on #344 then thanks

FlorianWoelki commented 10 months ago

So it's not related to files/folders?

You are right I did not notice that!! It's only affecting in-note icons. I'll keep an eye on #344 then thanks

I'll try to implement that as soon as I can. Thank you for your support and patience!

byjokese commented 10 months ago

Im refering to those icons in the File menu, but after some test, its the "iconInFrontmatterEnabled" setting that removes the icon from the file browser.

If that setting is enabled, as soon as I type something, the file icon gets removed.

EDIT: as it should, my bad. It is overridden by the property, as it should be, sorry for that.