News for hackers. Stuff that matters.
Re:Show HN: RemoteStorage – sync localStorage across devices... by eps on Friday January 12, 2024 @07:37PM (#38976126)
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?

Re:Show HN: RemoteStorage – sync localStorage across devices... by pancomplex on Friday January 12, 2024 @07:47PM (#38976197)
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... by eps on Friday January 12, 2024 @08:13PM (#38976366)
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... by Wowfunhappy on Saturday January 13, 2024 @12:23PM (#38982151)
I feel like, if the answers to these questions are important, you should be using a more complex solution.
Re:Show HN: RemoteStorage – sync localStorage across devices... by mondrian on Friday January 12, 2024 @09:08PM (#38976684)
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... by bandergirl on Saturday January 13, 2024 @01:27AM (#38977785)
The funny thing is that localStorage supports that.

Judging by the title, I thought this tool actually just synced the existing localStorage instead of being its own storage. Since localStorage has onChange events it would be trivial to built, it would still be sync, it wouldn’t require any changes to the existing code, etc

Re:Show HN: RemoteStorage – sync localStorage across devices... by NegativeLatency on Friday January 12, 2024 @07:46PM (#38976194)
Re:Show HN: RemoteStorage – sync localStorage across devices... by eps on Friday January 12, 2024 @08:05PM (#38976323)
So being temporary offline is not supported? That's pretty limiting.
Re:Show HN: RemoteStorage – sync localStorage across devices... by valsk on Saturday January 13, 2024 @02:22PM (#38983546)
Based on the comments I think this is just, not yet implemented. But is one of the next steps for truly cross device storage.