atom-community/sync-settings

Option to backup settings automatically

mateddy opened this issue ยท 11 comments

I made some changes in preferences (e.g. add an extra file in sync-settings), and then close and reopen Atom.

sync-settings: Latest backup is already applied.

Only when I manually edit anyfile in my gist, the sync setting dialog shows on startup.
I know I can manually run "Sync Settings: Backup", but isn't it supposed to be done automatically?

The backup command is triggered manually. Only the restore is being triggered automatically.

Should there be such an option?

It probably depends on your use case. If you use automatic backups with multiple computers you will likely run into problems that after backing up from A the automatic backup of B would overwrite the previous changes. Therefore it is currently not done automatically. But I can see in a single machine setup that it would be convenient. Maybe someone can work on a pull request for that.

Would also love this feature.

@dirk-thomas Agreed, so I think it is better to:
if (setting is changed)
alert("Setting changed, backup, restore or diff?");

See if I can code something this weekend.

@mateddy I think this is a good way to approach the problem. Consider also putting in a checkbox to allow automated backups without a prompt though, for single PC users.

Maybe something (optional) like this: when open Atom, automatically restore the backup and immediately after make a new backup; then when some change occur (or if is possible detect "close Atom" event), it do a new backup silently.

So when you open Atom in other computer it will do this again, syncing settings without need to prompt anything and reducing chances to accidental overwrite (what I believe will only occur if you open Atom simultaneously in other computer after make some change in first opened instance) ๐Ÿ˜„

I also got confused as well. I made a PR to README.md to clarify this point: #369

Hi, Github+Gist supports merging, right ?
So if two settings exist (local and gist), why not allow the user to manually merge on auto-restore ?
And only if the merge is resolved, apply + backup the merge.

Any movement on this? I really want this feature.

I won't lie and say I understand everything in the referenced PR, but as long as the option to automatically trigger backup defaults to off, this shouldn't be too harmful. When setting up a new computer, install this package, restore from backup, turn the option on (or maybe it got turned on by the restored settings?) and you should be fine.

If one of the computers is offline and thus can't backup, you might of course run into problems later if you change any settings there. (Although I already encounter issues multiple times a week because I forget to backup at work or at home, hehe.)

But as long as automatic backup being on and backup failing triggers a visible error (or, if it has to be, a warning), that should be OK I think.

If this doesn't get fixed, I'm tempted to learn enough Atom to write a package that uses Git to sync settings, not just Gist, so it can error out when restoring from backup isn't a simple fast-forward merge. I can't live without a settings sync package, but it's also pretty aggravating that I have to backup manually, and that backup/restore with a conflict between local and remote doesn't merge in any clean way. (The number of times I've had to scroll through the history of my syncing Gist to find out what package is missing from my current computer because of this...)

#596 added an option to backup on atom start and is released in v5.1.0