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

feat(js): reload unhandledRejection and uncaughtException plugins on configure #1184

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

BethanyBerkowitz
Copy link
Contributor

Status

READY

Description

Part of #1163

Core version 6.3.0 includes the ability for plugins to set shouldReloadOnConfigure. This PR turns that on for the unhandledRejection and uncaughtException plugins.

Related PRs

Listed in #1163

Todos

Steps to Test or Reproduce

cd packages/js
npm run test:server

@@ -22,14 +22,6 @@ export default class UncaughtExceptionMonitor {
makeListener() {
const honeybadgerUncaughtExceptionListener = (uncaughtError: Error) => {
if (this.__isReporting || !this.__client) { return }

if (!this.__client.config.enableUncaught) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Redundant now that the listener is removed in this case

@@ -18,13 +18,6 @@ export default class UnhandledRejectionMonitor {

makeListener() {
const honeybadgerUnhandledRejectionListener = (reason: unknown, _promise: Promise<unknown>) => {
if (!this.__client || !this.__client.config.enableUnhandledRejection) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Redundant now that the listener is removed in this case.

I'd only included !this.__client here because typescript wouldn't let me check !this.__client.config.enableUnhandledRejection otherwise.

expect(Singleton.config.__plugins.length).toBe(2)
})

it('clients produced via factory don\'t include plugins', function () {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are debating whether this is what we want in #1181, but I figured I'd document the current behavior.

@BethanyBerkowitz BethanyBerkowitz merged commit 9f1591e into master Sep 8, 2023
@BethanyBerkowitz BethanyBerkowitz deleted the BKB/reload-plugins branch September 8, 2023 13:38
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.

2 participants