-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: Wait for processing to finish before closing transport #2005
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
Conversation
packages/core/src/baseclient.ts
Outdated
@@ -58,6 +58,9 @@ export abstract class BaseClient<B extends Backend, O extends Options> implement | |||
/** Is the client still processing a call? */ | |||
protected _processing: boolean = false; | |||
|
|||
/** Processing interval */ | |||
protected _processingInterval?: NodeJS.Timeout; |
There was a problem hiding this 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 if this will be available in browser environments, which may cause same issus as with getCurrentHub
and Window
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
I'm not sure about the performance implications of this change, but the implementation looks fine |
So I agree, but considering this only ever applies if you call |
Fixes #2000
There was an issue with flush that we have to wait for processing of the client to finish first before we ask the transport to drain.
cc @sheerun thanks for pointing this out