Skip to content

[Bug] ScheduleNexusOperation doesn't raise NDE on Operation or Service mismatch #1231

@mjameswh

Description

@mjameswh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions