Skip to content

[Bug] MockActivityEnvironment's activityInfo().workflowExecution.runId is not a UUID #1706

Open
@TastyPi

Description

@TastyPi

What are you really trying to do?

I want to generate a UUID deterministically in an Activity (Slack). It works in a real Temporal instance because the activityInfo().workflowExecution.runId is a UUID, however the MockActivityEnvironment does not generate UUIDs.

I need to know whether the Workflow run ID is always a UUID, and I can depend on that. If so, the MockActivityEnvironment should be updated to match that behaviour.

Describe the bug

Minimal Reproduction

import { activityInfo } from "@temporalio/activity"
import * as uuid from "uuid"

export async myActivity(): Promise<string> {
  const info = activityInfo()
  return uuid.v5(info.activityId, info.workflowExecution.runId)
}

Run this activity in a real instance and it works. Run it with WorkflowTestEnvironment and it fails with TypeError: Invalid UUID.

Environment/Versions

@temporalio/testing: 1.11.7

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