Describe the bug
Core's ScheduleNexusOperation state machine does not raise a non-determinism error on replay when the command's fields don't match the corresponding NexusOperationScheduled history event.
This is inconsistent with Go and Java (which both check service and operation), and with Core's own ScheduleActivityTask and StartChildWorkflowExecution machines (which check ID + type under the IdAndTypeDeterminismChecks flag).
Proposed fix
-
In crates/sdk-core/src/worker/workflow/machines/nexus_operation_state_machine.rs, extend on_scheduled to compare the command's service and operation against the event attributes and return nondeterminism!() on mismatch.
-
We might need to gate the extra NDE checks with an SDK flag so that we don't suddenly start raising NDE for changes that happened in the past.
Describe the bug
Core's
ScheduleNexusOperationstate machine does not raise a non-determinism error on replay when the command's fields don't match the correspondingNexusOperationScheduledhistory event.This is inconsistent with Go and Java (which both check service and operation), and with Core's own
ScheduleActivityTaskandStartChildWorkflowExecutionmachines (which check ID + type under theIdAndTypeDeterminismChecksflag).Proposed fix
In
crates/sdk-core/src/worker/workflow/machines/nexus_operation_state_machine.rs, extend on_scheduled to compare the command's service and operation against the event attributes and returnnondeterminism!()on mismatch.We might need to gate the extra NDE checks with an SDK flag so that we don't suddenly start raising NDE for changes that happened in the past.