Skip to content

fix: preserve portable worker compatibility - #633

Draft
jumski wants to merge 1 commit into
portable-worker-hardeningfrom
portable-worker-release-followups
Draft

fix: preserve portable worker compatibility#633
jumski wants to merge 1 commit into
portable-worker-hardeningfrom
portable-worker-release-followups

Conversation

@jumski

@jumski jumski commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 621f55e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud

nx-cloud Bot commented Aug 14, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 621f55e

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 5m 59s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-14 12:26:25 UTC

Comment on lines +28 to +34
if (
!processLike?.env ||
!processLike.on ||
!processLike.off ||
!processLike.exit ||
!cryptoLike?.randomUUID
) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical Bug: Validation requires process.off to exist, but the type system treats offSignal as optional.

The validation throws an error if processLike.off is undefined, breaking compatibility with environments where process.off() doesn't exist (like older Node.js versions or some runtime environments).

This contradicts:

  1. The optional type: offSignal?: (signal: ProcessSignal, handler: ...) => void
  2. The usage with optional chaining: this.deps.offSignal?.(signal, this.signalHandler) at line 160 in ProcessPlatformAdapter

Fix: Remove the !processLike.off check from the validation:

if (
  !processLike?.env ||
  !processLike.on ||
  !processLike.exit ||
  !cryptoLike?.randomUUID
) {
  throw new Error('Process runtime is not available');
}

Then update line 41 to handle the missing method:

offSignal: processLike.off ? (signal, handler) => processLike.off?.(signal, handler) : undefined,
Suggested change
if (
!processLike?.env ||
!processLike.on ||
!processLike.off ||
!processLike.exit ||
!cryptoLike?.randomUUID
) {
if (
!processLike?.env ||
!processLike.on ||
!processLike.exit ||
!cryptoLike?.randomUUID
) {

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-633.pgflow.pages.dev

📝 Details:

  • Branch: portable-worker-release-followups
  • Commit: c13c75874f3d9d1b122f78e97ce0cfdd5b9fbf3b
  • View Logs

_Last updated: _

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.

1 participant