Open noahbaron91 opened 1 year ago
Hi @noahbaron91 - thank you for reporting this bug. Please excuse our delay in response here ā part of our support team was out for holidays.
This looks like an instance of a bug we already have on our radar (see #628 and #731). We have a potential fix for this, currently in draft in #1002, which still needs to be unit tested properly, and verified for production-readiness. We'll keep you posted on when we have an official release for this bug fix.
If you're willing and able to help us verify that this fixes your issue in the mean time, you could:
npm install @liveblocks/client@1.2.2-test5 @liveblocks/zustand@1.2.2-test5
Does that fix your issue as expected? Thanks in advance! š
No problem @nvie, Unfortunately, using version 1.2.2-test5 does not resolve the issue for me. I'm still experiencing the same duplication of list elements when using that version
That's unfortunate, we'll have to keep digging a bit more then. Thanks for trying it out and letting us know, @noahbaron91.
Describe the bug
Frequently changing array values are being temporarily duplicated by liveblocks when using the Zustand connector.
I prepared a simple example that displays this issue, similar to the project I'm working on: https://github.com/noahbaron91/liveblocks-array-bug / https://stackblitz.com/github/noahbaron91/liveblocks-array-bug
In this example, a layer is moving in and out of another layer at a quick rate. Liveblocks will randomly duplicate the stored ids when updated at a fast rate (approx 50ms per action).
I have noticed that it quickly recovers, but this short duplication is causing issues for me.
Steps to reproduce the behavior:
Expected behavior
Liveblocks should not duplicate array values and should instead stay consistent with the Zustand storage
Illustrations
https://github.com/liveblocks/liveblocks/assets/32229274/446107b5-7317-4d00-ab6d-2d5e85025bdb
Environment (please complete the following information):