After the refactoring the publish modal, I apparently changed a method signature in the api-call service that is used by the "Import Tale" case. The method was changed to return a Promise, where it previously accepted onSuccess/onFail as parameters. In doing so, I missed changing the other call to getFinalJobStatus to use promise chaining.
Fixes #471
Approach
Chain onSuccess / onFail to the return value instead of passing them as parameters - this allows us to more explicitly handle complex asynchronous interactions in the correct order.
How to Test
Checkout and run this branch locally, rebuild the dashboard
You should be brought to the Dashboard's "Compose" view
Choose an environment on the right side, then click "Launch New Tale"
Wait for your Tale to launch (watch docker logs -f celery_worker and wait for the import_tale task to complete)
You should be automatically brought to the Run view after your Imported Tale has launched
Launch a second Tale if you haven't already
With 2 Tales already running, repeat steps 3-5
Shortly after submitting, you should receive an error modal popup
You should see the following error in the modal: Unable to create instance. Server returned 400: You have reached a limit for running instances (2). Please shutdown one of the running instances before continuing.
Problem
After the refactoring the publish modal, I apparently changed a method signature in the
api-call
service that is used by the "Import Tale" case. The method was changed to return aPromise
, where it previously acceptedonSuccess
/onFail
as parameters. In doing so, I missed changing the other call togetFinalJobStatus
to use promise chaining.Fixes #471
Approach
Chain
onSuccess
/onFail
to the return value instead of passing them as parameters - this allows us to more explicitly handle complex asynchronous interactions in the correct order.How to Test
docker logs -f celery_worker
and wait for theimport_tale
task to complete)Unable to create instance. Server returned 400: You have reached a limit for running instances (2). Please shutdown one of the running instances before continuing.