Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): add an exit button for failed moveToAddressable area commands during Error Recovery #16729

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/src/organisms/DropTipWizardFlows/DropTipWizardFlows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ export function DropTipWizardFlows(
// after it closes.
useEffect(() => {
return () => {
dropTipWithTypeUtils.dropTipCommands.handleCleanUpAndClose()
if (issuedCommandsType === 'setup') {
void dropTipWithTypeUtils.dropTipCommands.handleCleanUpAndClose()
}
}
}, [])
}, [issuedCommandsType])

return (
<DropTipWizard
Expand Down
6 changes: 5 additions & 1 deletion app/src/organisms/DropTipWizardFlows/hooks/errors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export function useDropTipCommandErrors(
})
} else {
const messageText = message ?? ''
setErrorDetails({ header, message: messageText, type })
setErrorDetails({
header: header ?? t('cant_safely_drop_tips'),
message: messageText ?? t('remove_the_tips_manually'),
type,
})
Comment on lines +46 to +50
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some fallback copy just in case.

}
}
}
Expand Down
101 changes: 51 additions & 50 deletions app/src/organisms/DropTipWizardFlows/hooks/useDropTipCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,58 +109,59 @@ export function useDropTipCommands({
isPredefinedLocation: boolean
): Promise<void> => {
return new Promise((resolve, reject) => {
const addressableAreaFromConfig = getAddressableAreaFromConfig(
addressableArea,
deckConfig,
instrumentModelSpecs.channels,
robotType
)

if (addressableAreaFromConfig != null) {
const moveToAACommand = buildMoveToAACommand(
addressableAreaFromConfig,
pipetteId,
isPredefinedLocation,
issuedCommandsType
)
return chainRunCommands(
isFlex
? [
ENGAGE_AXES,
UPDATE_ESTIMATORS_EXCEPT_PLUNGERS,
Z_HOME,
moveToAACommand,
]
: [Z_HOME, moveToAACommand],
false
)
.then((commandData: CommandData[]) => {
const error = commandData[0].data.error
if (error != null) {
setErrorDetails({
runCommandError: error,
message: `Error moving to position: ${error.detail}`,
})
}
})
.then(resolve)
.catch(error => {
if (
fixitCommandTypeUtils != null &&
issuedCommandsType === 'fixit'
) {
fixitCommandTypeUtils.errorOverrides.generalFailure()
}
Promise.resolve()
.then(() => {
const addressableAreaFromConfig = getAddressableAreaFromConfig(
addressableArea,
deckConfig,
instrumentModelSpecs.channels,
robotType
)

if (addressableAreaFromConfig == null) {
throw new Error('invalid addressable area.')
}

reject(
new Error(`Error issuing move to addressable area: ${error}`)
)
})
} else {
setErrorDetails({
message: `Error moving to position: invalid addressable area.`,
const moveToAACommand = buildMoveToAACommand(
addressableAreaFromConfig,
pipetteId,
isPredefinedLocation,
issuedCommandsType
)

return chainRunCommands(
isFlex
? [
ENGAGE_AXES,
UPDATE_ESTIMATORS_EXCEPT_PLUNGERS,
Z_HOME,
moveToAACommand,
]
: [Z_HOME, moveToAACommand],
false
)
})
.then((commandData: CommandData[]) => {
const error = commandData[0].data.error
if (error != null) {
// eslint-disable-next-line @typescript-eslint/no-throw-literal
throw error
}
resolve()
})
.catch(error => {
if (fixitCommandTypeUtils != null && issuedCommandsType === 'fixit') {
fixitCommandTypeUtils.errorOverrides.generalFailure()
} else {
setErrorDetails({
runCommandError: error,
message: error.detail
? `Error moving to position: ${error.detail}`
: 'Error moving to position: invalid addressable area.',
})
}
reject(error)
})
}
})
}

Expand Down
Loading