Skip to content

Conversation

@alexsch01
Copy link
Contributor

@alexsch01 alexsch01 commented Nov 3, 2025

Additional details

Steps to test

How has the user experience changed?

PR Tasks


Note

Suppresses EPIPE errors from the ProjectConfigIpc child process (avoiding noisy terminal errors after Ctrl+C), with unit tests and a changelog entry.

  • Runtime (ProjectConfigIpc):
    • Handle EPIPE in child process error events for loadConfig() and registerSetupIpcHandlers(); log via debug and resolve instead of rejecting.
    • Type err as NodeJS.ErrnoException in handlers.
  • Tests:
    • Add packages/data-context/test/unit/data/ProjectConfigIpc-real-child-process.spec.ts to assert EPIPE handling/log messages.
  • Changelog:
    • Add bugfix note for suppressing EPIPE error after CTRL+C in cli/CHANGELOG.md.

Written by Cursor Bugbot for commit 36e1819. This will update automatically on new commits. Configure here.

@cypress-app-bot
Copy link
Collaborator

@alexsch01
Copy link
Contributor Author

The failures appear to be unrelated to the PR

@mschile mschile requested a review from AtofStryker November 4, 2025 17:37
@jennifer-shehane
Copy link
Member

@alexsch01 Thanks, we'll review when we have time and also make sure tests pass and merge.

@alexsch01
Copy link
Contributor Author

The readme change entry is in the wrong spot but I'm not going to fix it until all potential checks are complete

Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

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

I'm not sure we would want to block all broken pipe errors coming back from the process but I can't think of a reason as to what specifically. So I'm OK moving forward with the change. @cacieprins cam you think of a scenario where this would be problematic?

@alexsch01 are you able to add a unit test to https://github.com/cypress-io/cypress/blob/develop/packages/data-context/test/unit/data/ProjectConfigIpc.spec.ts

@alexsch01
Copy link
Contributor Author

@alexsch01 are you able to add a unit test to https://github.com/cypress-io/cypress/blob/develop/packages/data-context/test/unit/data/ProjectConfigIpc.spec.ts

Since the original issue happens sporadically when doing CTRL+C, it's tricky to test this

@AtofStryker
Copy link
Contributor

@alexsch01 are you able to add a unit test to https://github.com/cypress-io/cypress/blob/develop/packages/data-context/test/unit/data/ProjectConfigIpc.spec.ts

Since the original issue happens sporadically when doing CTRL+C, it's tricky to test this

@alexsch01 I'm more so talking about a unit test that emits and error to a mock child process and verifies the reject handler isn't called. I can take a look in setting that up if you'd like if that seems a bit challenging to do.

@alexsch01
Copy link
Contributor Author

@AtofStryker done

@AtofStryker AtofStryker self-requested a review November 19, 2025 02:25
resolve()

return
}
Copy link

Choose a reason for hiding this comment

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

Bug: EPIPE handler resolves with wrong type

When an EPIPE error occurs in loadConfig(), the promise resolves with undefined instead of the expected LoadConfigReply object containing initialConfig and requires properties. This causes runtime errors when callers try to access these properties, such as in ProjectConfigManager.initializeConfig() which accesses loadConfigReply.initialConfig and loadConfigReply.requires.

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

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

@cursoragent this should be unreachable

Copy link

Choose a reason for hiding this comment

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

Unable to authenticate your request. Please make sure to connect your GitHub account to Cursor. Go to Cursor

resolve()

return
}
Copy link

Choose a reason for hiding this comment

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

Bug: EPIPE handler resolves with wrong type

When an EPIPE error occurs in registerSetupIpcHandlers(), the promise resolves with undefined instead of the expected SetupNodeEventsReply object containing setupConfig, requires, and registrations properties. This causes runtime errors when callers try to access these properties, such as in ProjectConfigManager.handleSetupTestingTypeReply() which iterates over result.registrations.

Fix in Cursor Fix in Web

resolve()

return
}
Copy link

Choose a reason for hiding this comment

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

Bug: Missing resolved flag prevents proper error handling

When EPIPE occurs in loadConfig(), the code calls resolve() but doesn't set resolved = true. If another error occurs afterward, handleChildProcessError will incorrectly call reject() on an already-resolved promise instead of calling onError(), causing subsequent errors to be silently ignored rather than properly reported.

Fix in Cursor Fix in Web

resolve()

return
}
Copy link

Choose a reason for hiding this comment

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

Bug: Missing resolved flag prevents proper error handling

When EPIPE occurs in registerSetupIpcHandlers(), the code calls resolve() but doesn't set resolved = true. If another error occurs afterward, handleChildProcessError will incorrectly call reject() on an already-resolved promise, potentially causing unhandled promise rejection warnings. The resolved flag should be set before calling resolve().

Fix in Cursor Fix in Web

@AtofStryker
Copy link
Contributor

@alexsch01
Copy link
Contributor Author

@AtofStryker addressed

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.

Error: write EPIPE after CTRL+C in terminal

4 participants