phetsims / projectile-data-lab

"Projectile Data Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 0 forks source link

[CODAP] console errors when checking variables while in continuous mode #346

Open Nancy-Salpepi opened 3 months ago

Nancy-Salpepi commented 3 months ago

Test device MacBook Air M1 chip

Operating System 14.5

Browser Safari 17.5

Problem description For https://github.com/phetsims/qa/issues/1099, if I check and uncheck variables while data is being collected I get an Unhandled Promise Rejection error in the console.

Steps to reproduce

  1. With Console open in PSD select a sample size of 15
  2. Select continuous mode
  3. Press Launch button
  4. Check and uncheck variables

Visuals

Screenshot 2024-06-20 at 2 44 17 PM
samreid commented 2 months ago

@matthew-blackman and I investigated and found that CODAP has a 2000ms timeout in this code: https://github.com/phetsims/phet-io-sim-specific/blob/f4af064e9eb502c1763f046b39bb33f19c59413a/repos/projectile-data-lab/wrappers/codap/dependencies/iframe-phone-1.3.1.js#L205-L215

So when 500+ actions are being sent, or when the user tabs away for more than 2 seconds, we trigger this error. For the part that updates hundreds of projectiles in the table, we do not need the return value and we believe CODAP will correctly process it in time (there is no indication of the timeout interrupting any of the processes in CODAP). So it could be safe to ignore.

We discussed these strategies: