icidasset / diffuse

A music player that connects to your cloud/distributed storage.
https://diffuse.sh
Other
809 stars 66 forks source link

Use CRDTs for the user state #413

Open icidasset opened 6 months ago

icidasset commented 6 months ago

Currently state is synced without performing merge conflicts, the latest write always wins. Ideally we'd use CRDTs to avoid this problem. So when for example, two devices add a favourite at the same time and the state is fetched by both devices, it contains both new favourites instead of just the one that performed the last write.

It would also be great to have a signalling server that notifies every active client of new state updates. This does mean you'd need an additional server, so we'd probably need to add the ability to link a signalling server/service that uses a particular protocol.

Example of a library to use: Automerge