Skip to content

[Bug] Improper enum value comparison on workflow update #278

@cretz

Description

@cretz

Describe the bug

Error with trace:

ArgumentError: comparison of Symbol with 2 failed (ArgumentError)
               resp.stage >= Temporalio::Client::WorkflowUpdateWaitStage::ACCEPTED
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  from temporalio-0.4.0-x86_64 (linux) lib/temporalio/internal/client/implementation.rb:502:in `>='
  from temporalio-0.4.0-x86_64 (linux) lib/temporalio/internal/client/implementation.rb:502:in `block in start_workflow_update'
  from <internal:kernel>:187:in `loop'
  from temporalio-0.4.0-x86_64 (linux) lib/temporalio/internal/client/implementation.rb:493:in `start_workflow_update'
  from temporalio-0.4.0-x86_64 (linux) lib/temporalio/client/workflow_handle.rb:290:in `start_update'
  from temporalio-0.4.0-x86_64 (linux) lib/temporalio/client/workflow_handle.rb:320:in `execute_update'

Basically, per https://protobuf.dev/reference/ruby/ruby-generated/#enum enums inside protos may be symbols instead of integers, so we were improperly comparing as if it was an integer. We may need to change the LHS to something like Api::Enums::V1::UpdateWorkflowExecutionLifecycleStage.resolve(resp.stage)

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