obsidianmd / obsidian-api

Type definitions for the latest Obsidian API.
https://docs.obsidian.md
MIT License
1.65k stars 192 forks source link

Obsidian Sync issue with icon-folder #134

Closed FlorianWoelki closed 9 months ago

FlorianWoelki commented 9 months ago

I would like to ask, what the right way is to store zip files or any other possible large files so that Obsidian sync successfully syncs the files. We are currently experiencing some issues with Sync and the icon folder plugin. You've already created one issue here. But that didn't really solve the issue for some users. So I've tried to add a new syncing mechanism that just adds the zip files which includes the icons. But that didn't really work either (see this issue). So, I would like to ask, what's the right approach I need to follow for users not complaining anymore about syncing failures of this plugin?

lishid commented 9 months ago

If you're using a single file then you can put it in your plugin folder to have it synced with your plugin - other folders inside .obsidian is simply ignored which is why .obsidian/icons/ is never synced.

The support reply seems to link to the previous discussions we've had:

We've tried reaching out to them to make the .obsidian/icons/ the default behavior, but to no avail. https://github.com/FlorianWoelki/obsidian-iconize/issues/52

It seems like the plugin still defaults to unpacked icons in the plugin folder, which interferes with Sync functionality. I highly suggest defaulting the icon locations to NOT your plugin folder as it will get synced when the user chooses to sync their plugins, unless you pack them into a single file.

FlorianWoelki commented 9 months ago

If you're using a single file then you can put it in your plugin folder to have it synced with your plugin - other folders inside .obsidian is simply ignored which is why .obsidian/icons/ is never synced.

The support reply seems to link to the previous discussions we've had:

We've tried reaching out to them to make the .obsidian/icons/ the default behavior, but to no avail. FlorianWoelki/obsidian-iconize#52

It seems like the plugin still defaults to unpacked icons in the plugin folder, which interferes with Sync functionality. I highly suggest defaulting the icon locations to NOT your plugin folder as it will get synced when the user chooses to sync their plugins, unless you pack them into a single file.

Alright, thank you for the suggestion! I'll update the plugin so that the path defaults to .obsidian/icons/.

Thank you!

centifanto commented 9 months ago

Hmm I am confused. @lishid said other folders inside .obsidian is simply ignored which is why .obsidian/icons/ is never synced.

So why do we have that as the default if the contents never get synced?

lishid commented 9 months ago

Because this plugin creates thousands of icon files which clogs up the syncing process. Moving it there precisely prevents these icons from being synced.

centifanto commented 9 months ago

That's why I'm confused: the whole point of @FlorianWoelki raising this ticket is as said above:

what the right way is to store zip files or any other possible large files so that Obsidian sync successfully syncs the files?

Sounds like the answer you're giving is that there is no way, since the Obsidian backend logic is blocking that location. If this is correct, that means this plugin is incompatible with Sync. Which is a massive bummer. I hope there is a workaround possible

Edit: is the only workaround to manually zip all icons? And if course the plugin would have to be updated?

centifanto commented 9 months ago

Also, I only have 14 icon pack, not thousands. But I understand most users would probably download the default packs

3e9b commented 7 months ago

Edit: is the only workaround to manually zip all icons? And if course the plugin would have to be updated?

I have had luck doing embedded svgs in the css code, it seems to be the most fool-proof way to get them synced without issue, but this is very manual. I think this might solve the issue of syncing if we did that instead of files.

.nav-file-title .nav-file-title-content::before {
  -webkit-mask: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3e%3cpath d='M365.3 93.38l-74.63-74.64C278.6 6.742 262.3 0 245.4 0L64-.0001c-35.35 0-64 28.65-64 64l.0065 384c0 35.34 28.65 64 64 64H320c35.2 0 64-28.8 64-64V138.6C384 121.7 377.3 105.4 365.3 93.38zM336 448c0 8.836-7.164 16-16 16H64.02c-8.838 0-16-7.164-16-16L48 64.13c0-8.836 7.164-16 16-16h160L224 128c0 17.67 14.33 32 32 32h79.1V448zM96 280C96 293.3 106.8 304 120 304h144C277.3 304 288 293.3 288 280S277.3 256 264 256h-144C106.8 256 96 266.8 96 280zM264 352h-144C106.8 352 96 362.8 96 376s10.75 24 24 24h144c13.25 0 24-10.75 24-24S277.3 352 264 352z'/%3e%3c/svg%3e") no-repeat;
}