rojo-rbx / rojo

Rojo enables Roblox developers to use professional-grade software engineering tools
https://rojo.space
Mozilla Public License 2.0
947 stars 179 forks source link

Partial sync when multiple scripts updated at same time #137

Closed floydhorng closed 5 years ago

floydhorng commented 5 years ago

In Windows 10 (tested in both WSL and cmd), saving two scripts at the same time causes only one of them to be updated in studio.

Video with RUST_LOG and _G.ROJO_DEV_CREATE(): https://puu.sh/D4X7I/e9b03e97d7.mp4

The Rust application appears to see the change on the filesystem: image

While the roblox plugin seems to ignore the change. Note how saving two scripts causes the plugin to only download the source of one of the two scripts:

[Rojo-Trace] Request 74 success: status code 200 [Rojo-Trace] GET(75) http://localhost:34872/api/read/a97f55db-c00b-4f5f-ad9d-3f422edeb10b [Rojo-Trace] Request 75 success: status code 200 [Rojo-Trace] GET(76) http://localhost:34872/api/subscribe/4

RobloxStudioBeta_2019-03-24_21-22-09

Here is the full verbose RUST_LOG: RojoLog.txt

LPGhatguy commented 5 years ago

Thanks for the detailed report!

This looks like it might be a fun race condition in how my really crappy long-polling message queue works. 😅

Note that the server log is fine, and pushes all of the correct events into the queue (the Added: and Changed: sections in each snapshot result). In your video of the Roblox output, we can see that the client skips straight from /subscribe/2 to /subscribe/4 despite apparently not processing message 3!

This might've been a regression I introduced in porting the server over to Hyper. I probably need to extend the duration of a lock somewhere, we'll see. 😄