Skip to content

Commit 61f92f8

Browse files
authored
fix(app): fix LPC double counting offsets on new LPC wizard initialization (#18488)
Closes [RESC-458](https://opentrons.atlassian.net/browse/RESC-458) / EXEC-1609.
1 parent 01e3fc2 commit 61f92f8

File tree

3 files changed

+6
-192
lines changed

3 files changed

+6
-192
lines changed

app/src/organisms/LabwarePositionCheck/LPCFlows/__tests__/utils.test.ts

Lines changed: 0 additions & 139 deletions
This file was deleted.

app/src/organisms/LabwarePositionCheck/LPCFlows/useLPCFlows.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ import {
55
useCreateMaintenanceRunLabwareDefinitionMutation,
66
useDeleteMaintenanceRunMutation,
77
} from '@opentrons/react-api-client'
8-
import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data'
8+
import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data'
99

1010
import {
1111
useCreateTargetedMaintenanceRunMutation,
1212
useMostRecentCompletedAnalysis,
1313
useNotifyRunQuery,
1414
} from '/app/resources/runs'
1515
import { useNotifyDeckConfigurationQuery } from '/app/resources/deck_configuration'
16-
import { getRelevantOffsets } from '/app/organisms/LabwarePositionCheck/LPCFlows/utils'
1716
import {
1817
useLPCLabwareInfo,
1918
useCompatibleAnalysis,
@@ -150,14 +149,12 @@ export function useLPCFlows({
150149
// Avoid accidentally creating several maintenance runs if a request is ongoing.
151150
if (!isLaunching) {
152151
setIsLaunching(true)
153-
const labwareOffsets = getRelevantOffsets(
154-
robotType,
155-
ot2Offsets,
156-
flexOffsets ?? []
157-
)
158-
const createRunData = labwareOffsets != null ? { labwareOffsets } : {}
152+
// Inject OT-2 offsets into the maintenance run upon creation.
153+
// The Flex injects offsets directly in LPC commands and therefore should not load them into the maintenance run.
154+
const injectedOffsets =
155+
robotType === OT2_ROBOT_TYPE ? { labwareOffsets: ot2Offsets } : {}
159156

160-
return createTargetedMaintenanceRun(createRunData).then(
157+
return createTargetedMaintenanceRun(injectedOffsets).then(
161158
maintenanceRun => {
162159
setMaintenanceRunId(maintenanceRun.data.id)
163160
}

app/src/organisms/LabwarePositionCheck/LPCFlows/utils.ts

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)