THM-MoTE / webmodelica

A web-based Modelica-Toolbox
https://staging-webmodelica.mni.thm.de/
Mozilla Public License 2.0
8 stars 3 forks source link

Webmodelica requests neverending patience #111

Open CSchoel opened 5 years ago

CSchoel commented 5 years ago

After trying some simulations and accidentally staring some with two separate values for startTime (due to #106 ), I get the overlay with "simulating, be patient" that does not disappear. There is no way to cancel the simulation and it does not finish. Maybe the simulation engine has crashed?

njustus commented 5 years ago

Cancelation a fetch call to the backend isn't that easy :thinking: . In fact i don't know any solution except:

just ignore the result once the promise is completed.

We need some kind of interceptor, that is executed before the next callback is called. We can't cancel an already running callback. Seva Zaikov wrote an article about it, though i don't like his approach. Bluebird's Promise implementation seems to support cancelation.

Either way I added a button for cancelation to the overlay, that does nothing at the moment :laughing:

njustus commented 5 years ago

Another rather dump (but working :thinking: ) implementation would be, to just reload the page when the user clicks the cancel button. If we don't save the loading state into local storage (see #124) all callbacks associated with backend requests should be aborted.

Don't know if this works in every case, but if we provide a confirmation dialog that cancelation is dangerous, this would be a solution.

CSchoel commented 4 years ago

Reopening, because this is not fixed by adding a cancellation button with a scary warning message. We need the following changes: