From 1463456041f6d4acfaaf793911f2df9bf772d1d4 Mon Sep 17 00:00:00 2001 From: Jamey Huffnagle Date: Mon, 12 Aug 2024 15:48:27 -0400 Subject: [PATCH] fix(app): fix stale failedCommand during Error Recovery --- .../ErrorRecoveryFlows/hooks/useFailedLabwareUtils.ts | 6 +++--- .../hooks/useRetainedFailedCommandBySource.ts | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/organisms/ErrorRecoveryFlows/hooks/useFailedLabwareUtils.ts b/app/src/organisms/ErrorRecoveryFlows/hooks/useFailedLabwareUtils.ts index b0a0e821e69..bee6eb0474c 100644 --- a/app/src/organisms/ErrorRecoveryFlows/hooks/useFailedLabwareUtils.ts +++ b/app/src/organisms/ErrorRecoveryFlows/hooks/useFailedLabwareUtils.ts @@ -62,7 +62,7 @@ export function useFailedLabwareUtils({ failedCommandByRunRecord, runCommands, }), - [failedCommandByRunRecord?.error?.errorType, runCommands] + [failedCommandByRunRecord?.key, runCommands?.meta.totalLength] ) const tipSelectionUtils = useTipSelectionUtils(recentRelevantFailedLabwareCmd) @@ -74,12 +74,12 @@ export function useFailedLabwareUtils({ recentRelevantFailedLabwareCmd, runRecord ), - [protocolAnalysis, recentRelevantFailedLabwareCmd, runRecord] + [protocolAnalysis?.id, recentRelevantFailedLabwareCmd?.key] ) const failedLabware = React.useMemo( () => getFailedLabware(recentRelevantFailedLabwareCmd, runRecord), - [recentRelevantFailedLabwareCmd, runRecord] + [recentRelevantFailedLabwareCmd?.key] ) const relevantWellName = getRelevantWellName( diff --git a/app/src/organisms/ErrorRecoveryFlows/hooks/useRetainedFailedCommandBySource.ts b/app/src/organisms/ErrorRecoveryFlows/hooks/useRetainedFailedCommandBySource.ts index e9839a4eaf3..10231f5e0cc 100644 --- a/app/src/organisms/ErrorRecoveryFlows/hooks/useRetainedFailedCommandBySource.ts +++ b/app/src/organisms/ErrorRecoveryFlows/hooks/useRetainedFailedCommandBySource.ts @@ -41,7 +41,11 @@ export function useRetainedFailedCommandBySource( }) } } - }, [failedCommandByRunRecord?.key, protocolAnalysis?.id]) + }, [ + failedCommandByRunRecord?.key, + failedCommandByRunRecord?.error?.errorType, + protocolAnalysis?.id, + ]) return retainedFailedCommand }