Page MenuHomeElementl

[dagit] More optimistic switch behavior for schedules/sensors

Authored by dish on Jun 9 2021, 2:25 PM.



Currently, when switching on a schedule or a sensor, the switch remains "off" while in its loading state. Make this a little more responsive/optimistic by switching it to "on" in the loading state where we are turning it on. If it fails, it will revert back to "off".

Test Plan

Add a 5-second sleep to start_schedule mutation. Go to /instance/schedules, enable some schedules. Verify that the switch goes to "on" while in its loading state, then becomes enabled and remains on.

Raise an exception from the mutation and repeat. Verify that the switch reverts to "off".

Diff Detail

R1 dagster
Lint Not Applicable
Tests Not Applicable

Event Timeline

dish requested review of this revision.Jun 9 2021, 2:36 PM

@dish were you able to repro the laggy behavior before?

@prha I wasn't able to repro the behavior described in the issue, and am still not sure how it comes about.

This revision is now accepted and ready to land.Jun 14 2021, 5:22 PM