Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Prevent unwanted SIGINT error message from storybook #8977

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

Josh-Walker-GM
Copy link
Collaborator

Problem
Storybook is showing an error message when you exit via a SIGINT.

We have spent a few hours trying to understand why and work around this with no success.

Changes*

  1. Conditionally disable the additional default signal listeners based on the argv contents.
  2. Emit a custom event on process to trigger the telemetry shutdown.

Notes
I'm not really proud of this PR. Disabling based on the contents of argv isn't all that robust against false positives. Emitting a custom event on process is not really supposed to be done - hence why TS is complaining about the name of the signal.

This work has also highlighted that on my windows 11 machine the background scripts are not firing... This was working when I updated the span values to match those found to work in this PR comment nodejs/node#21825 (comment) when I reenabled windows telemetry. Maybe something has changed, maybe it's version specific (os or node). This is an active nodejs issue so my ability to solve this in redwood code is understandably limited.

Why isn't our CI finding this? We should investigate this too.

@jtoar Could you confirm on mac and windows that this PR prevents those additional error messages from storybook. If you also have the time I'd appreciate if you could check if the telemetry background job is firing when you test on windows.

I'll test this on ubuntu locally.

@Josh-Walker-GM Josh-Walker-GM added the release:fix This PR is a fix label Jul 26, 2023
@Josh-Walker-GM Josh-Walker-GM added this to the v6.0.0 milestone Jul 26, 2023
@jtoar
Copy link
Contributor

jtoar commented Jul 26, 2023

@Josh-Walker-GM working great on my mac. Will test on Windows tomorrow.

Working great on Windows for me.

@jtoar jtoar merged commit 2142ca5 into main Jul 27, 2023
27 checks passed
@jtoar jtoar deleted the jgmw-cli/storybook-error-message branch July 27, 2023 21:57
jtoar pushed a commit that referenced this pull request Jul 27, 2023
**Problem**
Storybook is showing an error message when you exit via a SIGINT. 

We have spent a few hours trying to understand why and work around this
with no success.

*Changes**
1. Conditionally disable the additional default signal listeners based
on the argv contents.
2. Emit a custom event on `process` to trigger the telemetry shutdown.

**Notes**
I'm not really proud of this PR. Disabling based on the contents of argv
isn't all that robust against false positives. Emitting a custom event
on `process` is not really supposed to be done - hence why TS is
complaining about the name of the signal.

This work has also highlighted that on my windows 11 machine the
background scripts are not firing... This was working when I updated the
span values to match those found to work in this PR comment
nodejs/node#21825 (comment) when
I reenabled windows telemetry. Maybe something has changed, maybe it's
version specific (os or node). This is an active nodejs issue so my
ability to solve this in redwood code is understandably limited.

Why isn't our CI finding this? We should investigate this too.

@jtoar Could you confirm on mac and windows that this PR prevents those
additional error messages from storybook. If you also have the time I'd
appreciate if you could check if the telemetry background job is firing
when you test on windows.

I'll test this on ubuntu locally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants