Issue: New peer connection interrupts and corrupts active mod downloads
Summary
When a new user joins a session, active mod downloads on other clients are immediately interrupted. This causes the .zip files to become corrupted. Subsequent attempts to resume or restart the downloads fail because the client attempts to read the corrupted partial files, preventing the user from ever reaching 100% completion.
Steps to Reproduce
- Client A starts downloading a set of mods
- Client B joins the server while Client A is mid-download.
- Observe that Client A's downloads immediately stop/drop.
- Restart the game on Client A.
- Attempt to sync mods again.
- Mods are potentially corrupted.
Expected Behavior
A new user joining should not interfere with existing socket streams or file writing processes for other peers. If a download is interrupted, the client should validate the file integrity and overwrite corrupted data rather than tripping over it.
Actual Behavior
- The join event triggers a "drop" in the download stream.
- The resulting partial
.zip files are saved to the disk in a corrupted state.
- On retry/relaunch, the downloader hits the corrupted percentage mark and stops entirely, unable to progress further.
Additional Notes
- No Lua console errors are generated during this process.
- The issue persists even with a clean BeamNG user folder.
- Potential Culprit: The logic handling new peer handshakes may be inadvertently resetting or closing active download buffers/threads.
Issue: New peer connection interrupts and corrupts active mod downloads
Summary
When a new user joins a session, active mod downloads on other clients are immediately interrupted. This causes the
.zipfiles to become corrupted. Subsequent attempts to resume or restart the downloads fail because the client attempts to read the corrupted partial files, preventing the user from ever reaching 100% completion.Steps to Reproduce
Expected Behavior
A new user joining should not interfere with existing socket streams or file writing processes for other peers. If a download is interrupted, the client should validate the file integrity and overwrite corrupted data rather than tripping over it.
Actual Behavior
.zipfiles are saved to the disk in a corrupted state.Additional Notes