phetsims / paper-land

Build and explore multimodal web interactives with pieces of paper!
https://phetsims.github.io/paper-land/
MIT License
10 stars 1 forks source link

Bug while saving/restoring programs #206

Closed jessegreenberg closed 5 months ago

jessegreenberg commented 5 months ago

During a demo today, @brettfiedler encountered a failure to load programs with

Error loading project: Cannot read properties of undefined (reading 'nameProperty')

We aren't sure how this happened but it is somewhat serious and needs to be investigated. Possibly a "save" operation happened twice before the first one finished? I had thought that case was handled but I will check to be sure.

jessegreenberg commented 5 months ago

@brettfiedler and I were able to reproduce the error when pressing the "Save Project" button twice rapidly. I think this is actually a front end problem where the timeouts that I added to report if the save operation takes too long. The server correctly restarts the save but the front end does not clear the timeouts.

I think a good way to fix this is to disable the save/send buttons while a request is being made.

EDIT - However, that doesn't really explain the original error that @brettfiedler encountered with nameProperty being undefined...

jessegreenberg commented 5 months ago

A fix for this has been pushed to the main branch - the send/save buttons are disabled after pressing until we get a response. @brettfiedler just FYI I wasn't able to reproduce the "nameProperty undefined" error that initially started all of this... but I am not sure what else to try to produce it. Hopefully this UI fix will make it go away. Please let me know if you see it again! Closing.