sdk-typescript icon indicating copy to clipboard operation
sdk-typescript copied to clipboard

[Bug] Installing "@temporalio/testing:1.4.0" along with 1.5.2 libs (activity/client/worker/workflow) breaks Temporal

Open Andrei199991 opened this issue 3 years ago • 2 comments

What are you really trying to do?

Upgrading 4 Temporal packages from 1.4.0 to 1.5.2, ie:

    "@temporalio/activity": "1.4.0",
    "@temporalio/client": "1.4.0",
    "@temporalio/worker": "1.4.0",
    "@temporalio/workflow": "1.4.0",

to

    "@temporalio/activity": "1.5.2",
    "@temporalio/client": "1.5.2",
    "@temporalio/worker": "1.5.2",
    "@temporalio/workflow": "1.5.2"

but I forgot to remove @temporalio/testing:1.4.0 from my project, crashing it entirely. (perhaps upgrading would've worked, too?)

Describe the bug

Keeping @temporalio/testing:1.4.0 w/ "@temporalio/activity": "1.5.2" & "@temporalio/client": "1.5.2" & "@temporalio/worker": "1.5.2" & "@temporalio/workflow": "1.5.2" in package.json will prevent a Temporal Worker from running - it results in a protobuf error.

image

Minimal Reproduction

npm i @temporalio/[email protected] @temporalio/[email protected] @temporalio/[email protected] @temporalio/[email protected] @temporalio/[email protected]

then start your Temporal Worker.

Environment/Versions

  • OS and processor: x86 Windows
  • Temporal Version: SDK 1.5.2, except for @temporalio/[email protected]
  • Are you using Docker or Kubernetes or building Temporal from source? - Docker

Additional context

  • @temporalio/[email protected] forces package-lock.json to install @temporalio/proto:1.4.3 in its root (dependencies). I believe this is the error. Uninstalling @temporalio/[email protected] fixed it.
  • I know, installing both 1.4.0 and 1.5.2 packages is dumb. But it shouldn't crash Temporal, should it?

I'm not very good at manipulating package-lock.json, but I venture to guess this is fixable by ensuring @temporalio/proto is listed as a "child" dependency rather than "root" dependency, eg:

correct result?

package-lock.json
{
    "dependencies": {
        "@temporalio/activity": {
            "dependencies": {
                "@temporalio/[email protected]": { ... }
                // ...
            }
        }
        // ...
    }
    // ...
}

instead of

package-lock.json
{
    "dependencies": {
        "@temporalio/[email protected]": { ... }
        "@temporalio/activity": {
            "dependencies": {
                // ...
            }
        }
        // ...
    }
    // ...
}

Andrei199991 avatar Dec 20 '22 11:12 Andrei199991

hold on, this info isn't entirely accurate. i might reopen / fix this bug report

Andrei199991 avatar Dec 20 '22 11:12 Andrei199991

just in case you're curious - my package-json.lock file was broken on multiple levels. the "correct result" listed above is what fixed it (first I manually fixed/unnested the subdependency array, then I deleted the lockfile and ran npm i).

I don't know if this is my or Temporal SDK's fault (although all i did was npm i... I think I'm clean), so I won't bother you with this... 😅

Andrei199991 avatar Dec 20 '22 11:12 Andrei199991