Skip to content

fix(worker): accept pre-loaded LoadedDataConverter - #2722

Open
umeraamir69 wants to merge 1 commit into
temporalio:mainfrom
umeraamir69:fix/worker-loaded-data-converter-1953
Open

umeraamir69 wants to merge 1 commit into
temporalio:mainfrom
umeraamir69:fix/worker-loaded-data-converter-1953

Conversation

@umeraamir69

Copy link
Copy Markdown
Contributor

Summary

  • Worker.create() always called loadDataConverter(), which require()s the payload converter and can break instanceof checks against ESM-imported classes.
  • Apply the same isLoadedDataConverter guard the Client already uses so a pre-loaded converter is kept as-is.
  • Unit test that a passed LoadedDataConverter instance is preserved on the compiled options.

Closes #1953

Test plan

  • pnpm --filter @temporalio/common build && pnpm --filter @temporalio/worker build
  • pnpm --filter @temporalio/test exec ava ./lib/test-worker-options.js

Match the Client's isLoadedDataConverter guard so Worker.create() keeps
an ESM-imported payload converter instead of reloading it via require().
@umeraamir69
umeraamir69 requested a review from a team as a code owner November 20, 2026 18:05

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Worker.create() ignores pre-loaded LoadedDataConverter, always re-loads via require()

1 participant