Skip to content

[BUG] Parallel Downloads - First user's instance gets cancelled #221

@florinm03

Description

@florinm03

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

  1. Client A starts downloading a set of mods
  2. Client B joins the server while Client A is mid-download.
  3. Observe that Client A's downloads immediately stop/drop.
  4. Restart the game on Client A.
  5. Attempt to sync mods again.
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions