Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete Ack Overrides Undo Operation Temporarily #1225

Open
griffins-planera opened this issue Oct 12, 2023 · 2 comments
Open

Delete Ack Overrides Undo Operation Temporarily #1225

griffins-planera opened this issue Oct 12, 2023 · 2 comments
Labels
bug Something isn't working Custom App

Comments

@griffins-planera
Copy link

Describe the bug

This manifests when performing heavy operations or in high latency environments. First you delete an element in storage and then undo that delete. If your undo operation is submitted before the ack of the original delete returns, the delete ack will temporarily remove the element once again. Once the undo ack returns the element in local storage will resolve correctly.

In our app, which is very similar to the collaborative whiteboard example, this causes a flicker of elements on screen. The user experience of this bug is that they delete an element accidentally and immediately undo. They'll see the element restored successfully, but shortly after it will disappear again for no reason. Eventually the element comes back, but until then the user is left trying to figure out if their element is gone forever.

To Reproduce

Steps to reproduce the behavior:

  1. Ensure websocket delay either through a large storage state or network latency
  2. Perform a delete operation
  • Elements should disappear from local state and UI
  1. Immediately undo
  • Elements should reappear
  1. Wait for the delete ack to return
  • Elements will disappear a second time
  1. Wait for the undo ack to return and restore the elements
  • Elements will finally reappear

Expected behavior

If a delete operation has been undone, the ack of that delete should not remove the restored elements from local state.

Illustrations

image

Here you can see a screenshot of the websocket when this situation manifests in our app. Note the message size and timings on the right. Both acks return after the user operations are submitted, and the elements disappear in-between the first and second acks.

Environment (please complete the following information):

  • @liveblocks/react@0.18.0
  • chrome v117.0.5938.149
@griffins-planera griffins-planera added bug Something isn't working triage needed The issue needs to be reviewed by the team labels Oct 12, 2023
@jrowny
Copy link
Contributor

jrowny commented Oct 19, 2023

Thanks for the detailed report. I just wanted to confirm that you are using 0.18.0? Are you able to try this with a newer version?

@griffins-planera
Copy link
Author

@jrowny Yes we are using 0.18.0. Next week we are planning to upgrade to latest anyways, so I can try this then.

@adigau adigau added the 🎪 Room label Apr 24, 2024 — with Linear
@adigau adigau changed the title Delete Ack Overrides Undo Operation Temporarily Delete Ack Overrides Undo Operation Temporarily Apr 24, 2024
@adigau adigau removed the triage needed The issue needs to be reviewed by the team label May 9, 2024
@adigau adigau added the Engineering label May 9, 2024 — with Linear
@adigau adigau removed the Engineering label May 9, 2024
@adigau adigau removed the 🎪 Room label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Custom App
Projects
None yet
Development

No branches or pull requests

3 participants