When launching a Tale from the Browse view, we need to keep track of which Tales are launching/launched/stopped/stopping/etc, or which ones have encountered an error and what the error said. Because this is not tracked in the API, we've needed to invent some state in the tale-browser code that keeps track of this.
We've neglected to reset this status upon a new instance finishing being launched, since I assumed that navigating would cause the page to repopulate - this is apparently not the case.
Fixes #549
Approach
Added a callback handler to reset the button state once the instance is up for both of "Launch Tale" use cases in the Browse view: startTale and submitCopyAndLaunch
How to Test
Checkout and run this branch locally, rebuild the dashboard
Login to the WholeTale Dashboard
Navigate to the Browse view
Launch a Tale
You should be automatically navigated to the Run > Interact view
Click your browser's back button or the "Return to Dashboard" link at the top-left
You should be brought back to the Browse view
You should see a spinner on the Tale's button
While the Tale is still launching, right-click the tab in your browser and choose Duplicate Tab
A new tab should open to the Browse view - call this Tab 2, where your original one is Tab 1
Note that the spinner is also present in Tab 2
Wait for the Tale to finish launching, then "Duplicate Tab" again
Another new tab should open to the Browse view - call this Tab 3
Note that the spinner is not present in Tab 3
The Tale's button should be enabled
The button should read Stop
Check Tabs 1 & 2 again to verify button state matches that of Tab 3
Problem
When launching a Tale from the Browse view, we need to keep track of which Tales are launching/launched/stopped/stopping/etc, or which ones have encountered an error and what the error said. Because this is not tracked in the API, we've needed to invent some state in the
tale-browser
code that keeps track of this.We've neglected to reset this status upon a new instance finishing being launched, since I assumed that navigating would cause the page to repopulate - this is apparently not the case.
Fixes #549
Approach
Added a callback handler to reset the button state once the instance is up for both of "Launch Tale" use cases in the Browse view:
startTale
andsubmitCopyAndLaunch
How to Test
Duplicate Tab
Stop
Stop