theRAPTLab / gsgo

GEM-STEP Foundation repo migrated from GitLab June 2023
1 stars 1 forks source link

Safe Load - [merged] #701

Closed benloh closed 1 year ago

benloh commented 2 years ago

Merges dev-bl/next-gui-safeload -> dev-next-gui

Background

When editing scripts, especially if using the code editor, it is easy to accidentally save a script that will not compile. This would cause Main to stop running, and ScriptEditor would either show "Waiting for Main..." or could not submit updated scripts to the server.

Once this happens, the student would have to drop out into VSCode and fix the project file by hand, and restart the server to recover.

The Fix

This introduces a number of fixes that should keep Main running, and therefore ScriptEditor running, and allow ScriptEditor to submit script changes to fix any issues.

We also now try to catch and display errors so that they are not invisibly being dumped to the dev console.

Specific fixes:

To Test

  1. Add a line prop xxx to a script and submit it. You should see an error on Main, but both Main and ScriptEditor remain running.
  2. Reload Main. In spite of the script error, Main should load. But you should see "?" in place of any sprites. There is no other obvious error, but we'll work on that next.
  3. Change prop xxx to prop and submit it. This should no longer trigger an error and the sprites should load.
  4. Open the gemprj file you're playing with and mess up the JSON (e.g. remove a bracket).
  5. Reload Main. You should get an alert that says something like "The project "starter_034" could not be loaded! Are you sure it exists?", followed by a second error.
  6. Fix the JSON and reload Main. It should load again.
benloh commented 2 years ago

added 1 commit

Compare with previous version

benloh commented 2 years ago

added 8 commits

Compare with previous version

benloh commented 2 years ago

added 1 commit

Compare with previous version

benloh commented 2 years ago

added 2 commits

Compare with previous version

benloh commented 2 years ago

added 1 commit

Compare with previous version

benloh commented 2 years ago

added 1 commit

Compare with previous version

benloh commented 2 years ago

added 1 commit

Compare with previous version

benloh commented 2 years ago

added 1 commit

Compare with previous version

benloh commented 2 years ago

added 3 commits

Compare with previous version

benloh commented 2 years ago

added 1 commit

Compare with previous version

benloh commented 2 years ago

added 2 commits

Compare with previous version

benloh commented 2 years ago

mentioned in commit 5acb47428bf373d7436c517509cbba3ed7f80717