tinybase
tinybase copied to clipboard
Default value in values schema is being sent as a write op to connected peers
Discussed in https://github.com/tinyplex/tinybase/discussions/165
Originally posted by haggen July 28, 2024
So here's the situation; I have a typed store with a key x in Values, and I also am using a WebSocket synchronizer. Whenever a new client connects to the synchronizer server, the current value of x is overwritten with its default value.
I was expecting the new client to receive the latest value instead of zeroing it for everyone.
Is that by design or a bug?
Having the same problem right now! The solution for me was removing the default field, and handle the 'undefined' case on the code I'll try to post a codepen reproducing the bug later