News for hackers. Stuff that matters.
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