arenaxr / arena-web-core

An environment to view and interact in multiuser virtual and augmented reality.
https://docs.arenaxr.org
BSD 3-Clause "New" or "Revised" License
40 stars 28 forks source link

Slow networks/`eduroam` cause cascade JS failures #351

Open mwfarb opened 2 years ago

mwfarb commented 2 years ago

Describe the bug On slow networks, or eduroam on CMU's campus, events begin to occur out of order and cause cascading race condition crashes starting with AFRAME:

arena-core.js:101 Uncaught TypeError: Cannot read properties of undefined (reading 'systems')
    at h.loadUser (arena-core.js:101)
    at EventTarget.<anonymous> (arena-core.js:101)
    at t.emit (arena-core.js:50)
    at arena-core.js:101

To Reproduce Steps to reproduce the behavior:

  1. On chrome's developer tabs: Network > Throttle > Fast3G > then reload any scene.
  2. Several systems fail to load, SideMenu controls are missing.
  3. Probability: Low, realistically seen by mobile users at the EDGE.
  4. or...
  5. At CMU, use eduroam WiFi > then reload any scene.
  6. Several systems fail to load, SideMenu controls are missing, Jitsi will not connect, and not send errors to ARENAHealth checks.
  7. eduroam is a little worse since users have no feedback at all.
  8. Probability: Medium, realistically seen by some CMU users.

Expected behavior Race conditions should at least be mitigated by proper signaling. Perhaps reports to ARENAHealth if bandwidth is consistently measurable.

mwfarb commented 2 years ago

Added mitigation temporarily: https://github.com/conix-center/ARENA-core/commit/367657f448aaa8b49966d195e84a2f9c4e56ff92.