casual-simulation / casualos

Casual Open Simulation for the Web
https://ab1.bot
MIT License
48 stars 8 forks source link

Weird Tag Update Issues #301

Open KallynGowdy opened 10 months ago

KallynGowdy commented 10 months ago

When dragging a bot around fairly quickly, other tabs will see the bot sometimes snap back to the center of the screen or to a spot where it was never dragged. This is a bug as updates should only be sent for tags that have been changed, and other tabs should only change tags to the correct updated values.

KallynGowdy commented 10 months ago

This bug happens on ab1.bot and also on alpha.ab1.bot (after the WebsocketController changes), so it is likely related to YJS itself or something else, but not the WebsocketController.

Blitzy commented 3 months ago

This video shows another situation where this is easily reproducible and is most likely related.

https://www.loom.com/share/4348bdb33887423f9fc0204560a2b156?sid=7d385ce7-4805-4e75-915a-5523bb12bffa

Blitzy commented 3 months ago

Yeah I believe that these two situations are the same underlying issue.

I did the bot drag test between two tabs in the same inst and logged the position to the console with each change and the second tab is getting undefined for some of the tags as the bot is being dragged in the other tab.

image

KallynGowdy commented 1 month ago

This issue on YJS seems to be related. I've also added a repro here: https://github.com/casual-simulation/casualos/blob/f79e16421c826eeede89c289567e06045a44284d/src/aux-runtime/YjsTest.spec.ts