You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Express/Koa/Restify plugin adds new error callbacks on each request without removing old callbacks, resulting in the wrong request being reported and timeouts
#1875
Closed
hansottowirtz opened this issue
Nov 27, 2022
· 1 comment
When autoTrackSessions: true (which is the default), the same requestClient is used as for previous requests. This means that a new callback is added to the error callbacks array on every request. This has the following consequences:
The wrong request is reported in the Request tab on Bugsnag (the body of the first request is always used, regardless of the request that caused the error)
After many requests, the Bugsnag flush times out (we think this is the reason)
Is it possible that old callbacks are not removed when they should be?
Steps to reproduce
I think any express/koa/restify app without autoTrackSessions: false will have this problem.
Environment
We're using the Express plugin together with the AWS Lambda plugin.
Bugsnag version: 7.17.0
The text was updated successfully, but these errors were encountered:
hansottowirtz
changed the title
Express plugin adds new error callbacks without removing old callbacks, resulting in the wrong request being reported and timeouts
Express/Koa/Restify plugin adds new error callbacks on each request without removing old callbacks, resulting in the wrong request being reported and timeouts
Nov 27, 2022
Describe the bug
These lines are run on every request in the express plugin:
bugsnag-js/packages/plugin-express/src/express.js
Lines 22 to 32 in 8d607ca
When
autoTrackSessions: true
(which is the default), the samerequestClient
is used as for previous requests. This means that a new callback is added to the error callbacks array on every request. This has the following consequences:Is it possible that old callbacks are not removed when they should be?
Steps to reproduce
I think any express/koa/restify app without
autoTrackSessions: false
will have this problem.Environment
We're using the Express plugin together with the AWS Lambda plugin.
The text was updated successfully, but these errors were encountered: