Page MenuHomeElementl

[dagit] Repair launch button loading state
ClosedPublic

Authored by dish on Jan 25 2021, 5:44 PM.

Details

Summary

When clicking the launch button in Dagit, we set the button to a "submitting" state, but we currently just use a 300ms timeout to change the button back to its original state. The problem is that sometimes the launch behavior takes more than 300ms, and to the user it appears that nothing has happened while they wait for the launch to begin.

To repair this, make the onClick behavior an async function and keep the "submitting" state in place until the async function completes. In this way, if a request is made by the launch, we will wait for it to complete before changing the state back.

Test Plan

Submit a run via playground, use debuggers to verify that the "submitting" state remains in place while awaiting the async function.

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dish requested review of this revision.Jan 25 2021, 5:51 PM

Oh good catch—seems like a major oversight that this wasn't awaiting the mutation!

This revision is now accepted and ready to land.Jan 25 2021, 7:23 PM
This revision was automatically updated to reflect the committed changes.