By writing an infinite loop in your code and refreshing the page, it’s possible to lose your work.
Tested in Firefox and Chrome on Windows 8, within the multiplayer Dungeon Arena level.
Steps to reproduce:
- Create some code with an infinite loop (or that just runs for too long).
- Cast it. You should get a notice saying that your code probably has an infinite loop.
- Refresh the page. You should, shortly after the loading bar gets to “Ready”, receive the “Infinite Loop Detected” pop-up. This gives you the “Try Again” and “Reset Level” options. “Try Again” gets the same pop-up, and “Reset Level” naturally destroys your work.
This is an issue as a single bug in the user’s code can erase potentially a lot of work.
- Don’t run the user’s code on level load, and instead wait for the user to cast or hit play to run it the first time. Then, the user could fix the infinite loop. Added bonus of reducing load times probably pretty significantly.
- Add another option to the “Infinite Loop Detected” pop-up, letting you open the level (without running the user’s code) to fix the infinite loop.
Are there any workarounds for this currently?
Edit: found a workaround in at least one case. My code was merely running slowly rather than looping infinitely, and selecting a different opponent for whatever reason made it pass the timeout check. This probably doesn’t help for true infinite loops or for non-multiplayer levels, though.