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...
Show HN: RemoteStorage – sync localStorage across devices and browsers
41–50 of 69 posts
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#42How 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.
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
#43Earlier 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?
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#44Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#45I 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.
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
#46Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#47How 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.
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#48Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#49Your landing page at https://remote.storage/ is so good, I love the minimalism. Six lines of code tell me exactly what it does.
Re: Show HN: RemoteStorage – sync localStorage across devices and browsers
#50That's so cool ! I was thinking how I'd make work syncing my offline first app and this looks promising