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(js): move unhandled rejection monitor to a class, fix filter for domainUncaughtExceptionClear #1166

Merged
merged 3 commits into from
Aug 21, 2023

Conversation

BethanyBerkowitz
Copy link
Contributor

@BethanyBerkowitz BethanyBerkowitz commented Aug 18, 2023

Status

READY

Description

Closes #1165

Makes the format of the unhandled rejection listener match that of the uncaught exception listener and adds unit tests.

I also noticed that the filter for domainUncaughtExceptionClear needed unit tests and was missing the return keyword.

Todos

  • Tests

Steps to Test or Reproduce

Outline the steps to test or reproduce the PR here.

npm run test:server

@BethanyBerkowitz BethanyBerkowitz changed the title Move unhandled rejection monitor to a class chore(js): move unhandled rejection monitor to a class Aug 18, 2023
})
})

// Seems like it was meant to work this way but was never implemented?
Copy link
Contributor Author

@BethanyBerkowitz BethanyBerkowitz Aug 18, 2023

Choose a reason for hiding this comment

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

This is easy to add to make it match how uncaughtException works (eg return right away if __isReporting is true... but there may be a reason it doesn't do that... leaning toward minimal change with this PR.

Copy link
Member

Choose a reason for hiding this comment

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

🤔 I don't remember. So, now it was changed to return is __isReporting is true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided not to change how this was working in this PR.

__isReporting is only used when enableUnhandledRejection is false... this seems like it was probably an oversight but it may have been for a good reason... it's difficult to know when there were no tests or comments written.

Happy to re-examine, but I was hoping to keep this PR to just a change in the format of the unhandled rejection code and adding the tests rather than changing the logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's an issue to review this! #1167

@BethanyBerkowitz BethanyBerkowitz changed the title chore(js): move unhandled rejection monitor to a class fix(js): move unhandled rejection monitor to a class, fix filter for domainUncaughtExceptionClear Aug 18, 2023
Copy link
Member

@subzero10 subzero10 left a comment

Choose a reason for hiding this comment

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

❤️ I love seeing all these tests!

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.

[js] update structure of unhandled rejection listener to match uncaught exception
2 participants