Client settings sync - general discussion

As mentioned in the ideas list, this idea caught my attention, I have been wondering how this would look like if implemented, according to my research the whole idea can be broken into 3 parts:

  • Sync normal settings
  • Sync plugins
  • Sync keyboard shortcuts

Here is a doc on how VS code sync settings work

We will be having options in the settings to turn each of the 3 sync on/off.

Not all settings should be or can be synced, we can sterilise the settings that needs to be synced and save it to the sync target (i.e the cloud storage) as a file, there will be a single global .json file in the target which all participating devices will read and update. Some settings might even be platform dependent, we need to take care of that too.

Plugins

We should be storing and maintaining a list of plugins that will be or is installed in all devices, either on the same file or a different one and install/uninstall plugins accordingly but what if someone who has plugin sync turned wants to add a plugin to a particular device without affecting other devices? It is something that needs to be considered too?

Keyboard Shortcuts

This is something very platform dependent, we might structure our json file in a way to allow for different values for different platforms for the same command, that would fix it. The previous issue of plugin pertains here too, should we allow for specific key bindings to be local only? Or specific keybindings to be disabled on remote but keep it on target.

Maybe we can do something similar to how .gitignore works, but this will only complicate the task (maybe we can keep it for later)

I was able to pin out the file where most of the work will go (or start from in a way), I noticed there are 3 parts of synchronisation: 'update_remote', 'delete_remote', 'delta' and I propose to add another one to the list something like fetch_settings which will be doing all the work here.

Let me know what you all think and if I'm missing something here.

Edit:

Thinking more about it, it won't be as simple as maintaining a global file of config, we will need a proper way to generate diffs and update according to the timestamp.

4 Likes

Thanks for looking into it. The sync algorithm as you'll see is relatively generic - it synchronises "items" and whether it's a note, notebook or tag the logic is the same (with a few special cases). So ideally for settings we'd go for a similar approach, and it will just be one additional item to synchronise.

We also have the "info.json" file on the sync target and perhaps that could be used to store and sync settings?

we will need a proper way to generate diffs and update according to the timestamp.

Yes that's one of the challenge - you need a way to merge settings that may have been modified in various devices. That probably means you'll need to store a timestamp with each setting, then when merging you'd keep the setting value with the latest timestamp.

1 Like

Yes I was looking into it last night, and have a better understanding now, so what I planned now is that, settings will be in a single json file where each settings will have a timestamp of last_update, we will use it to resolve conflicts when occurs, maybe we will create a new base_item for the settings file so that we can utilize the existing sync mechanism, and but there will only be a single one. (Or maybe info.json already has a way to deal with it, need to check)

Coming to plugins I think each plugin should be mapped to a base_item, we need to handle plugins and keyboard shortcuts this way since it’s different in nature from settings. They are more similar to tags and notes than it is to settings. The sync mechanism will work perfectly with this.

Now the major challenges ahead are:

  • Figure out how to map settings and plugins to base_item.
  • decide on the format of settings file (it should consider cross platform differences too) and which settings are needed to be synced.

For options related to this feature I think we can have 3 new settings:

  • sync settings
  • sync plugins
  • sync keyboard shortcuts

Also under settings we can provide an advanced section where we can toggle each settings to sync on/off, for eg if we don’t want to have same theme on all devices this will allow it.

1 Like

Btw is is required that I figure out everything on how to implement it and have a crystal clear idea and write it in my proposal or is it okay to say something like: these are the points that I will be discussing and figure out while in gsoc period

What you describe makes sense and I can't think of any issue at this point. As you develop the solution you might find you'll need to adjust your plan but that sounds like a good starting point.

For the proposal you don't need to dig into the technical details. Give a high level overview, similar to what you have posted above, mention the possible solutions you've investigated, the pros and cons, etc. And during GSoC indeed you can adjust your plan or even go for a completely different solution if it makes sense (it's something you'd have to discuss and agree with your mentor of course).

I just came across Joplin and it's a wonderful application! It's a must-have notes application! Kudos to the team for adding so many features and maintaining them. Thanks, Laurent!

So I use Joplin across different operating systems and different machines and I just came to know that the sync feature doesn't sync the settings!

The problem is this I need to configure everything across all the instances of Joplin and is a bit tedious as well as difficult to do!

Example:- My layout, my spell check language choice, some new words that I have added to one of the Joplin instances, theme, etc.

It would be great if we could sync the settings and spell check database as well so that the user has a seamless experience across all the instances :slight_smile:

Waiting for this feature come up as this feature would highly enhance the user experience and also will be helpful for all of us using Joplin. Hope to see this integrated into the application as soon as possible.

Thanks,
Viraj Shelke

Do we have some pull requests or milestones set for this feature on GitHub?

This can be an additional feature that can be launched once the settings sync is rolled out for now we can keep all the settings in sync.

We might also need to sync the spell check words that the user has saved :slight_smile: Please take a note for this as well. Thanks!

I would also like to contribute to the codebase if any help is needed.

It is a GSoC project idea so if it is selected from a proposal then work will start on it over the summer.

1 Like

I see Daeraxa! I am not much used to and aware of how GSoC works, but I googled it. Sounds good :slight_smile:

Summer sounds a bit too far but then I get it! Really looking forward to this functionality and feature. As asrient mentioned we can refer VS Code since they too have implemented something similar :slight_smile:

How can I join this?

I just read GSoC 2022 Ideas | Joplin can I join for the "14. Client settings sync"? I am not a student although.

GSoC is no longer just for students but the deadline for it was last month.

Hi, thanks for taking interest in this project. One thing I would like to mention here is, according to the proposal I think we would be primarily focusing on syncing settings and installed plugins. I’m not very sure if this covers custom words added to the dictionary.
Honestly I haven’t looked at how this feature actually works under the hood so I can’t comment on it’s feasibility yet.

The first thing that I observe here is there's no section/page in the Joplin settings to manage (add/remove) such words so this might posses an issue as well if we sync something that can't be managed by the user directly.