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): load natural pipetteId during error recovery #15970

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,13 @@ const buildMoveToAACommand = (

export const buildLoadPipetteCommand = (
pipetteName: PipetteModelSpecs['name'],
mount: PipetteData['mount']
mount: PipetteData['mount'],
pipetteId?: string | null
Copy link
Contributor

Choose a reason for hiding this comment

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

will this ever be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! See L311 on ManageTips.tsx

): CreateCommand => {
return {
commandType: 'loadPipette',
params: {
pipetteId: MANAGED_PIPETTE_ID,
pipetteId: pipetteId ?? MANAGED_PIPETTE_ID,
mount,
pipetteName,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,15 @@ function useRegisterPipetteFixitType({
instrumentModelSpecs,
issuedCommandsType,
chainRunCommands,
fixitCommandTypeUtils,
}: UseRegisterPipetteFixitType): void {
React.useEffect(() => {
if (issuedCommandsType === 'fixit') {
const command = buildLoadPipetteCommand(instrumentModelSpecs.name, mount)
const command = buildLoadPipetteCommand(
instrumentModelSpecs.name,
mount,
fixitCommandTypeUtils?.pipetteId
)
void chainRunCommands([command], true)
}
}, [])
Expand Down
1 change: 1 addition & 0 deletions app/src/organisms/DropTipWizardFlows/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface DropTipWizardRouteOverride {
export interface FixitCommandTypeUtils {
runId: string
failedCommandId: string
pipetteId: string | null
copyOverrides: CopyOverrides
errorOverrides: ErrorOverrides
buttonOverrides: ButtonOverrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import { DT_ROUTES } from '../../DropTipWizardFlows/constants'
import { SelectRecoveryOption } from './SelectRecoveryOption'

import type { PipettingRunTimeCommand } from '@opentrons/shared-data'

Check failure on line 27 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/ManageTips.tsx

View workflow job for this annotation

GitHub Actions / js checks

'PipettingRunTimeCommand' is defined but never used

Check failure on line 27 in app/src/organisms/ErrorRecoveryFlows/RecoveryOptions/ManageTips.tsx

View workflow job for this annotation

GitHub Actions / js checks

'PipettingRunTimeCommand' is defined but never used
import type { PipetteWithTip } from '../../DropTipWizardFlows'
import type { RecoveryContentProps, RecoveryRoute, RouteStep } from '../types'
import type { FixitCommandTypeUtils } from '../../DropTipWizardFlows/types'
Expand Down Expand Up @@ -200,6 +201,7 @@
subMapUtils,
routeUpdateActions,
recoveryMap,
failedPipetteInfo,
}: RecoveryContentProps): FixitCommandTypeUtils {
const { t } = useTranslation('error_recovery')
const {
Expand Down Expand Up @@ -301,9 +303,17 @@
}
}

const pipetteId =
failedCommand != null &&
'params' in failedCommand.byRunRecord &&
'pipetteId' in failedCommand.byRunRecord.params
? failedCommand.byRunRecord.params.pipetteId
: null

return {
runId,
failedCommandId,
pipetteId,
copyOverrides: buildCopyOverrides(),
errorOverrides: buildErrorOverrides(),
buttonOverrides: buildButtonOverrides(),
Expand Down
Loading