vrtmrz / obsidian-livesync

MIT License
4.94k stars 162 forks source link

obsidian settings synced even though the "Sync hidden files" is off #172

Open hilsonp opened 1 year ago

hilsonp commented 1 year ago

There is something strange:

  1. "Sync hidden files" is off on all devices
  2. The following mango query shows ".obsidian" files in my self-hosted CouchDB
    {
    "selector": {
      "_id": {
         "$regex": "^(?!h:).*\\.obsidian.*"
      }
    }
    }
  3. I shutdown all obsidian applications
  4. I delete all those entries in my CouchDB database
  5. I start Obsidian on one Laptop => it recreates all entries.

Is that the wanted behaviour ?

hilsonp commented 1 year ago

And because of this, on a newly configured iPhone, using a newly created setup uri, the settings get synchronised 😕

image

vrtmrz commented 1 year ago

Thank you for pointing this out. I was not aware of this. As you said, this should not be synchronised unless we do not turn the feature on.

Fixed in v0.17.22! I appreciate your daily contribution and do not mean to be brazen, but could you try this one as well?

hilsonp commented 1 year ago

Well. I can try it but honestly, the "hidden files sync" is a little too oscure to me and I do not fully understand how it works. I daily work on obsidian on one laptop and went ahead quite far in fine tuning the settings. For now, I keep a log of things I do in order to replicate manually the settings on my Laptop2 and on my iPhone.

I hate having to do that manually and would love to find a way to "port" my settings (or some of them) from one host to another one but I'm afraid to enable "hidden file sync". Indeed, I do not understand which device's settings will have precedence. How can I make sure that Laptop1 settings are untouched ? This is my "master" device.

Also, some settings should differ between devices (for example Batch Size and Batch Limit can be higher on my laptops than on my iPhone).

I was also awaiting on results on #83

If you explain me a little how settings are being managed (which ones are seen as "the good ones to keep"), I may activate it again and provide feedback on #172 and #83.

I was also thinking of using the Settings/About/Override config folder in order to have one .obsidian_win10 and another .obsidian_iphone but the fact that I will have to maintain 95% of the settings manually for only 5% delta is tedious and I'm still looking for a better solution. Any idea is welcome.

vrtmrz commented 1 year ago

I think this is a pretty accurate question. Every new feature lacks documentation. Thank you for asking me!

In JSON files, there was a priority order, but now they are merged as best as possible (or as your operation). If they conflict with unresolvable differences, a merge dialogue is displayed.

For other files, the newer files (in modified time) will be used. And we can update the modified time by pressing the Touch button in the settings dialogue.

If we have problems synchronising a specific plugin, we can ignore files of that by Skip patterns. This is why obsidian-livesync is included in that by default. As you pointed out, the configuration of LiveSync is not suitable for automatic synchronisation. However, also named badly.

And, just for your information, I use a Screwdriver to maintain these specific configurations. I have found that these changes are fortunately not frequent.

If you have any questions (or concerns), please feel free to ask me!

hilsonp commented 1 year ago

You are awesome! In your explanations and in the solutions you have in place!

Thank you for all the explanations.

Screwdriver seems awesome too, especially on iPhone where we cannot view the hidden files/directories. And combined with LiveSync, this can get quite powerful.

As you suggested, I'll cover the 5% delta by excluding them.

I will give a try and provide feedback here.