Fix script crashed state and retry in the script runner UI #2534 #2552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Explanation
The UI now properly handles the “crashed” state for a script and gives better indication that the script should be retried instead of stopped and started. I think the previous semantics for fatal/crashed were incorrect so I fixed them. Previous to this change, “crashed” was lumped together with error/paused/waiting/breakpoint. However the script is still actively running for those states, but “crashed” actually means the script has stopped. Therefore, “crashed” should reset to the init/start state instead.
For retrying, logically there's two types of retries that exist: Retry on Error and Retry on Crashed. They should be treated differently because of the aforementioned “error means still running” and “crashed means no longer running” (also consider that error will pause on the errored line—crashed will not).
Because of this, instead of appropriating the current
pauseOrRetryButton, it makes sense to renamestartOrGoButtontostartGoRetryButtonand use that. If you try to use the existing retry button and endpoint on a crashed script, it will do nothing (further confirming what I'm saying about crashed scripts not running, and how the previous UI code didn't model this).With these changes,
this.fataldoesn’t mean or do anything anymore, so I removed it. Note there was already a dead code path that checkedthis.state == 'fatal’even though that’s not a state the backend will ever send.Validation
Here's what it does now:
Here's what it did previously (notice "retry" also didn't work!):