Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to sync data via cloud #5

Open
themightychris opened this issue Dec 14, 2017 · 15 comments
Open

Ability to sync data via cloud #5

themightychris opened this issue Dec 14, 2017 · 15 comments

Comments

@themightychris
Copy link

Just writing to a configured path in the local filesystem and letting people bring their own sync/backup tech would be ideal...but extensions can't do that

Following this example it should be possible and pretty quick to implement a way to auto-backup the spaces JSON export to dropbox periodically: https://github.com/vmi/dropbox-js-for-chrome-extension

It would be nice to support a noncommercial destination though. Maybe via webpacking js-git, writing to a private git repo could be supported.

My ultimate dream would be being able to connect the extension to an arbitrary private git repo that would store spaces in an easily diffed/merged loose tree format that could support auto-merging from multiple clients.

@themightychris
Copy link
Author

My thinking on this has evolved a bit, I really want sync too now that I use the extension regularly on two computers. There's a proprietary service called Workona now that kinda does this but I don't like how it works or its model (it excludes pinned tabs from saved space and moves tabs between windows when you switch workspaces rather than switching windows)

Keybase.io offers free private git repos. If we could provide an easy flow for someone to link the extension to a git repo like one hosted by keybase, and model workspaces as trees being pushed/pulled between clients, we'd have really powerful backup and cross-computer workspaces. Merges could just use an always-take-newest policy to automatically resolve conflicts so if you did open the same workspace and change them on multiple computers at the same time one would overwrite changes to the other, but that's not really a big deal since you could pull up the git repo and find whatever link you lost if the client itself didn't show a history. Plus if the extension pushed and pulled in close to real time as tabs were opened and closed, and attempted to mirror tab changes that come in from remote on already-open windows, conflicts would never really happen much in practice and it would be pretty straightforward to get used to what happens when you open a workspace in parallel

@deanoemcke
Copy link
Owner

@themightychris i'd like to reply to you properly when i have the time, but for now i'll just say that i'm totally on the same page as you. i've put a lot of thought into workspace syncing - probably too much actually and it will result in something over engineered.

when i saw workona, i thought i might be able to just switch to that, but i totally agree that there's some messed up things with their implementation. i really don't understand why they've done it that way. but perhaps they might address that soon?

for now, i like the idea of some simple synching. but not sure about using git repos? i'd probably prefer dropbox and/or google drive integration. why are you against this? purely because they are commercial entities? i feel like it's a better price to pay than going with something more technical / less user-friendly.

@themightychris
Copy link
Author

themightychris commented Sep 13, 2018

I'm not against them, but if we're going to start with and possibly only support one mode, git is the most universal. I personally like that it gives me a usable way to access history effectively right out of the box before any special UI is built. Dropbox and drive don't really give practical access to past versions, esp of things that aren't in their in-house doc formats. I want the freedom of knowing I can always go back to anything.

If the data model is one text file per space with one URL per line or something simple like that, a big advantage with git is that we get synchronization and really good bidirectional conflict resolution for free. With the full usable history you can bias the merge to always resolve automatically and not bother the user, knowing they can always go look at what got erased. Git has been implemented purely in JS several times over and brings a lot of free plumbing to the table over just storage.

Keybase and github are just as commercial as dropbox/drive, and I don't think using Git as a backend needs to be any more tehcnical or less user-friendly than drive/dropbox. For one the UIs for syncing stuff to dropbox/drive and picking a storage location on both ends is a potential trap for users, and I there's potential for the workflow via keybase or github to be very simple

@themightychris
Copy link
Author

Imagine using something like https://www.npmjs.com/package/isomorphic-git as the entire backend for spaces. Right off the bat it can be using indexdb-backed repo within the browser to record its data directly into a git tree with a commit history, and then at any point a user can link a remote and synchronize their existing full history and spaces

@Thovthe
Copy link
Contributor

Thovthe commented Oct 11, 2018

Is there really no way to write to a simple file from an extension? I would love to use Syncthing if at all possible.

Willing to hack things up with symlinks if necessary.

@Thovthe
Copy link
Contributor

Thovthe commented Oct 11, 2018

Possibly one of these two issues should be closed: #5 or #9

@deanoemcke deanoemcke changed the title Feature request: Auto external backup Ability to sync data via cloud Jan 26, 2019
@Thovthe
Copy link
Contributor

Thovthe commented Jan 28, 2019

We might be able to make something that takes output from Spaces and writes to a file on the FS with nativeMessaging. This would enable users to use whatever syncing system they would like and maintain control of their data.

@themightychris
Copy link
Author

themightychris commented Jan 29, 2019 via email

@Thovthe
Copy link
Contributor

Thovthe commented Feb 2, 2019

That is another fine option. I think my preference would still be to have the spaces saved to a simple text file (or collection of them). It's transparent, very flexible, and would allow me to back up easily and use Syncthing which is secure, distributed, massively cross-platform. With a file (or collection of them) one could still sync to a Nextcloud instance or similar.

+ It's more unix-y but only weirdos like me care about that.

PS: Maybe the title of this issue should just be "Enable Sync Across Devices" cloud implies some things that are non-goals.

@themightychris
Copy link
Author

themightychris commented Feb 2, 2019

Ideally both are options, I'm a fan of the WebDAV approach because it's less moving pieces, you don't need some active process running and working to know your spaces are synced. The extension could give direct feedback about sync status that way.

Running your own webdav server is easy, but I am having trouble finding any cheap clean SaaS option people could use that would make this path comparably easy to using Dropbox in the way you suggest for those who don't want to self-host, so that's one point for your approach. The search results for SaaS webdav drive are a mess, but if we could identify a couple good options for a recommended hosts list that would change things.

@themightychris
Copy link
Author

Ohh, how about saving to Solid? Seems ideal

@Thovthe
Copy link
Contributor

Thovthe commented Jun 20, 2019

chrome.storage.sync should work, no?

Though I don't sign in to any of my browsers.

@IgorMinar
Copy link

IgorMinar commented Mar 27, 2020

chrome.storage.sync would be the most natural and easy way to implement this. Since the extension can already serialize the state of spaces, syncing the state via chrome.storage.sync is likely just a small amount of code.

Would there be interest in a community contributed PR that would enable cloud sync via chrome.storage.sync API?

@Thovthe
Copy link
Contributor

Thovthe commented Apr 5, 2020

Probably, but there's a contingent that won't make use of that because we don't sign in to our browsers.

@rosenpin
Copy link

I think the chrome storage would be ideal, most users log into their browsers with their Google accounts
If it solves 80% of the use cases there's no reason not to add it.
You could always add support for more sync options later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants