clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.41k stars 110 forks source link

Rust SDK: investigate reports of out-of-order row update callbacks #1973

Closed bfops closed 2 days ago

bfops commented 1 week ago

From https://discord.com/channels/1037340874172014652/1138987509834059867/1193034730464088184 :

[10:34 PM]Hudson: Idk if this is an already known error or if it is some obscure error from my code base but is it normal that the Update event is being received before Insert? [Image shows a string of Update, followed by Insert, followed by Update again, apparently on the same row.] [10:38 PM]⚙ phoebe: Which SDK are you using? And are these changes made within a single tx (reducer), or across several txes (reducer calls)? [10:41 PM]Hudson: using rust sdk 0.8, on the server side a DynamicEntity is instantiated when a client connect and it is updated on a reducer that is looping all the time, on the client I did with rust too and managed to send these updates from the callback to the main godot thread via a single mpsc channel

Is the server sending the TXes out of order? Or is the Rust SDK receiving them out of order, processing them and invoking callbacks out of order due to its Tokio weirdness?

UPDATE: I (pgoldman 2024-02-16) suspect this is related to the subscription consistency issues which Shubham and Noa have been investigating. If the issues re-surface, I will re-evaluate.