Skip to content

Commit

Permalink
fix(protocol-designer): fix diffing function in makeTimelineMiddleware (
Browse files Browse the repository at this point in the history
#15235)

Closes RQA-2752

Undefined object values were resulting in `false` returns for `substepsNeedsRecompute`, in turn resulting in not propogating up errors from moving labware conflicts. This PR uses deep object equality checks with lodash isEqual to properly return true if our robot timeline needs recomputing.
  • Loading branch information
ncdiehl11 authored and ryanthecoder committed May 28, 2024
1 parent d30eaab commit 11b740d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import isEqual from 'lodash/isEqual'
import {
getArgsAndErrorsByStepId,
getOrderedStepIds,
Expand All @@ -21,7 +22,7 @@ const hasChanged = (
): boolean =>
Object.keys(nextValues).some(
(selectorKey: string) =>
nextValues[selectorKey] !== memoizedValues?.[selectorKey]
!isEqual(nextValues[selectorKey], memoizedValues?.[selectorKey])
)

const getTimelineArgs = (state: BaseState): GenerateRobotStateTimelineArgs => ({
Expand Down

0 comments on commit 11b740d

Please sign in to comment.