fix(app): Delineate failed command source #15933
Merged
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.
Closes RQA-2913
Overview
One tricky problem of the mono repo's typing for a run command derived from protocol analysis and a run command derived from a runRecord is they both share the same type,
RunTimeCommand
, but they actually aren't equivalent. They share the same property names and value types, but the exact values of those types often differs, such askey
andid
. If you need information from the run itself, you need the run command, and if you need information from analysis, you need the analysis command, but typing doesn't catch this misue.When a dev wants to find some information about a command that is only available from protocol analysis, such as exact details about the labware/well/the next command/the previous command/etc., they need to match a command that they do have with one from analysis based on some property of the supplied command with one from analysis. When this command is actually from the run and not protocol analysis, these APIs often return
null
, because properties likeid
are actually different between the two commands, and a lot of the utility function APIs the app uses unfortunately filters on the protocol analysis command'sid
.At least how I see it, there are several viable ways to tackle this problem (with varying degrees of successfully solving the root issue), listed from greatest to least amount of effort:
RunTimeCommand
is distinctly unique fromAnalysisDerivedCommand
, and the two are not equivalent.Admittedly, I've chosen door 4 during a lot of the development of error recovery, but it's time to pay for my mistakes. I've decided to choose door 3 this time. While door 2 may seem feasible, it's actually not, because:
RunTimeCommand
for protocol analysis commands is such a systemic thing in the app that we should probably go with what is likely best solution at that point (which I think is Error in Documentation #1, but tbd).There's a lot of noise in this PR with testing. There are really just two files (
CategorizedStepContent
anduseRetainedFailedCommandBySource
) that fix several bugs, including:FailedStepNextStep
render but you are actually on the penultimate step or actual last step, we don't render empty "next steps" anymore.Test Plan and Hands on Testing
Changelog
Risk assessment
low, see test plan