Live data from Hacker News

Show HN: RemoteStorage – sync localStorage across devices and browsers

github.com

41–50 of 69 posts

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#41
post #36

How are the conflicts resolved? Machine A is online and sets "x" to 1. Machine B is offline and sets "x" to 2. Machine B goes online. What the resulting state on A and on B? What if initially A was offline and B was online?

Since B is offline it never sets x to 2: https://github.com/FrigadeHQ/remote-storage/blob/main/packag...

So being temporary offline is not supported? That's pretty limiting.

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#42
post #36

How are the conflicts resolved? Machine A is online and sets "x" to 1. Machine B is offline and sets "x" to 2. Machine B goes online. What the resulting state on A and on B? What if initially A was offline and B was online?

This is handled by Redis, as such, the last write will win. As the primary key is tied to the user id, there will not really be a concept of Machine A vs Machine B as the end user can only be in one place at a time.

I see. The case in question is when the user switches between two devices, each of which may be sometimes offline. This can cause older changes hitting the server later than the new ones, in which case, ideally, they should be rejected.

What happens to storage requests made while offline? Are they cached locally and propagated once online, or are they lost?

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#43
post #42

Earlier quoted context omitted.

This is handled by Redis, as such, the last write will win. As the primary key is tied to the user id, there will not really be a concept of Machine A vs Machine B as the end user can only be in one place at a time.

I see. The case in question is when the user switches between two devices, each of which may be sometimes offline. This can cause older changes hitting the server later than the new ones, in which case, ideally, they should be rejected. What happens to storage requests made while offline? Are they cached locally and propagated once online, or are they lost?

[deleted]

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#45
post #21

I love the simplicity and kinda wish that was actually built into Chrome. I know it would probably break things but if Google could automatically sync local storage and IndexedDB when I'm signed into Chrome on all my devices then a lot browser of apps wouldn't require making an account or even a server for that matter.

Thank you! My goal was to make it as stupidly simple as possible in the first version. I am also pretty surprised Google hasn't yet built something that solves this. When localStorage first came out, I was expecting a natural extension would be a way to sync it to a centralized store to avoid having state reset between sessions/devices.

Something tells me they'll be able to find the resources now to productize your code - or something like it.

Thanks very much for improving the landscape and the help pushing the boundaroes of webapps.

This is super cool.

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#46
The bit about finding a unique ID for the user is the whole pain point though. The only way to do that really is for the user to create an account on some service that I host. And if I have that, I probably have my own hosted data storage anyway.

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#47
post #36

How are the conflicts resolved? Machine A is online and sets "x" to 1. Machine B is offline and sets "x" to 2. Machine B goes online. What the resulting state on A and on B? What if initially A was offline and B was online?

This is handled by Redis, as such, the last write will win. As the primary key is tied to the user id, there will not really be a concept of Machine A vs Machine B as the end user can only be in one place at a time.

Users can have an app in multiple tabs though, and apps can read/write local storage in the background.

Re: Show HN: RemoteStorage – sync localStorage across devices and browsers

#49
post #9

Your landing page at https://remote.storage/ is so good, I love the minimalism. Six lines of code tell me exactly what it does.

I can’t seem to be able to get to this URL. Safari iOS says the url is invalid. I wonder if that means dns issue or “that’s not a url, silly”
Post reply on HN