Skip to content

Commit 36a7501

Browse files
authored
fix(app): fix error recovery crashing the app (#15837)
Closes RQA-2887
1 parent 7316d72 commit 36a7501

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

app/src/organisms/ErrorRecoveryFlows/__tests__/ErrorRecoveryFlows.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ describe('ErrorRecoveryFlows', () => {
218218

219219
const newProps = {
220220
...props,
221-
failedCommand: { ...mockFailedCommand, id: 'NEW_ID' },
221+
failedCommand: null,
222222
}
223223
rerender(<ErrorRecoveryFlows {...newProps} />)
224224
expect(mockReportErrorEvent).toHaveBeenCalledWith(newProps.failedCommand)

app/src/organisms/ErrorRecoveryFlows/hooks/useFailedLabwareUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function useFailedLabwareUtils({
5757
}: UseFailedLabwareUtilsProps): UseFailedLabwareUtilsResult {
5858
const recentRelevantFailedLabwareCmd = React.useMemo(
5959
() => getRelevantFailedLabwareCmdFrom({ failedCommand, runCommands }),
60-
[failedCommand, runCommands]
60+
[failedCommand?.key, runCommands]
6161
)
6262

6363
const tipSelectionUtils = useTipSelectionUtils(recentRelevantFailedLabwareCmd)

app/src/organisms/ErrorRecoveryFlows/hooks/useRecoveryTakeover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function useRecoveryTakeover(
6262
clearClientData()
6363
}
6464
}
65-
}, [clearClientData, isActiveUser])
65+
}, [isActiveUser])
6666

6767
const showTakeover = !(activeId == null || thisUserId === activeId)
6868

app/src/organisms/ErrorRecoveryFlows/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function ErrorRecoveryFlows(
121121
const analytics = useRecoveryAnalytics()
122122
React.useEffect(() => {
123123
analytics.reportErrorEvent(failedCommand)
124-
}, [failedCommand])
124+
}, [failedCommand?.key])
125125

126126
const { hasLaunchedRecovery, toggleERWizard, showERWizard } = useERWizard()
127127
const isOnDevice = useSelector(getIsOnDevice)

0 commit comments

Comments
 (0)