obsidian-livesync icon indicating copy to clipboard operation
obsidian-livesync copied to clipboard

Bug: "Plugins and settings (beta)" - "Device and vault name" option is also synced between devices

Open Yaruma3341 opened this issue 3 years ago • 4 comments

When syncing my plugins' settings, the "device and vault name" option of obsidian-livesync is also synced.

Example: I initially configure Obsidian and its plugins on my PC and give it the name "PC-main". Now I setup my mobile and want it to sync with my PC. My mobile gets the name "mobile-main". Then I sync my vault including plugins and settings - afterwards my mobile will also be called "PC-main" because this setting was also synced.

A workaround for this is to change the "device and vault name" setting after syncing, however this would force me to never sync my settings of obsidian-livesync again or to do this whenever I synced the settings.

I would really appreciate if this could be fixed :)

Yaruma3341 avatar Feb 12 '22 08:02 Yaruma3341

@Yaruma3341 You're right, Self-hosted LiveSync's setting couldn't be synchronized. So, at v0.7.0, I made this to select easier. Could you please try this?

image

vrtmrz avatar Feb 16 '22 10:02 vrtmrz

@vrtmrz First of all, thanks for your quick hotfix and response! I gave it a quick shot and at first glance, it seems to work totally fine :) However, this doesn't allow me to sync my obsidian-livesync settings across devices then. For sure I can just quickly set this up by hand but let's say I'm having 4 devices to be synchronized (actually this is my case). In that case I'll have to boot 3 other devices and perform the same changes on each of them. This should not happen too often but I think you're getting the point ;) I regard this new feature in v0.7.0 as very useful for many cases, however this may not be the perfect solution for the original problem here. Do you think you could implement the "device and vault name" setting as a static, not synchronizable field on top of v0.7.0? I would really appreciate that!

Yaruma3341 avatar Feb 17 '22 19:02 Yaruma3341

@Yaruma3341 Thank you for testing! I'm glad to hear that working the plugin well.

And you are right, All configurations except "Device and Vault name" are synchronizable. This was the obstacle. So, since v 0.7.1, It doesn't be stored in the file. It is stored in the Obsidian's storage (I didn't realize this... Thank you for the advice!) Could you please try this?

vrtmrz avatar Feb 18 '22 11:02 vrtmrz

@vrtmrz I tested v0.7.1 and after some struggle I manged to get it running :D It works just as it should - I can finally sync my livesync-settings across devices without overwriting the "device and vault name" option :partying_face: . However, when testing this, I noticed 1 or 2 bugs, as I do not know if one of these is the wanted behaviour:

  1. If I change any of obsidian-livesync settings, they are not written to the remote database until the periodic sync is running or if "Sync on Save", "Sync on File Open" or "Sync on Start" is triggered. I think this is "wanted" behaviour because there is no such setting at the moment to directly push setting-changes as it exists for files like "Sync on Save" option. Therefore I would recommend to add a new option to the "Sync settings" tab called "Sync on Settings changed" or something like that. As the name already says, this would sync settings directly when doing any changes to them.
  2. If the plugin notices any files that have not been synced with the current device yet, it does the sync process automatically. However, when the plugin notices that some settings were changed, it just notifies the user that there are some changes but the sync-process has to be triggered manually by the user in "Plugins and settings" tab using the new UI you implemented in v0.7.0.

So to sum this up:

  1. :+1: v0.7.1 now doesn't sync "Device and vault name" option anymore.
  2. :bulb: Recommendation/Request: Add a new option called "Sync on Settings changed" to "Sync settings" tab to allow instant synchronization of settings without delay.
  3. :warning: Bug: Changes of settings are recognized by the plugin and the user gets a notification about that, however the sync-process has to be triggered manually (bug?). From a logical point of view, the plugin should perform the sync process for settings automatically as it already does for files in the vault.

Do you think (2) and (3) could be implemented/fixed?

Keep up the good work! This project is amazing :smiley:

Yaruma3341 avatar Feb 18 '22 22:02 Yaruma3341