whole-tale / dashboard

Whole Tale Dashboard
http://wholetale.org
MIT License
7 stars 2 forks source link

Deleting a Running Tale Shows Running Instance #495

Closed ThomasThelen closed 5 years ago

ThomasThelen commented 5 years ago

When deleting a Tale that's running, the page doesn't re-direct and you're left with an un-selected Tale and the running instance.

Steps to Reproduce

  1. Launch a Tale
  2. Navigate to its Run page
  3. Delete the Tale
  4. Note that the instance is still embedded in the browser

demo

bodom0015 commented 5 years ago

I believe that I have seen this before as well, but am unable to figure out the root cause of what's happening there. It's also worth noting that once #459 is merged, this will be fixed regardless as the Interact tab now adjusts itself based on instance state.

I had previously added a spinner with a delay there #447, and I believe that helped slightly with #213 but appears to have not helped with this issue - I have proposed previously that this issue should be fixed on the server-side by adding an InstanceStatus.DELETING or similar.


Verbose Details

If you check the console when you're in this state, it's very likely that it's the same stack trace as #395. We see this occasionally when deleting an EmberObject from the server, and the cache in Ember-Data's store becomes out-of-sync. Ember-Data attempts to do a backgroundReload or reload of a model that has been deleted from the server, and it gets confused and throws an error.

Since we are already using Ember-Data's destroyRecord in most cases, I am not sure how to further signal to the Ember-Data store that a model needs to be purged from its cache and that further queries for the model should be stopped.

It's possible that something about the asynchronous cleanup required by our DELETE /instance/:id code is confusing Ember, which perhaps expects that once .destroyObject() returns, the model should be deleted.

bodom0015 commented 5 years ago

This should finally be resolved by https://github.com/whole-tale/girder_wholetale/pull/357 and the related UI change within #550