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 TypeError: this.queue.close is not a function #93

Merged
merged 4 commits into from
Dec 19, 2019
Merged

Fix TypeError: this.queue.close is not a function #93

merged 4 commits into from
Dec 19, 2019

Conversation

SkeLLLa
Copy link
Contributor

@SkeLLLa SkeLLLa commented Dec 15, 2019

In some rare cases there's a possibility when close will be called before subscribe will happen. In this case that error could cause even app server crash. Also it prevents this.queue.destroy() to be called.

I don't know how to properly test this case, cause it's caused by some abnormal behaviour of client side. Tried some options with closing ws client right after establishing connection, sending some crappy staff into it - nothing caused this bug to appear.
Anyway it's present and needed to be fixed.

In some rare cases there's a possibility when `close` will be called before `subscribe` will happen. In this case that error could cause even app server crash. Also it prevents `this.queue.destroy()` to be called.

I don't know how to properly test this case, cause it's caused by some abnormal behaviour of client side. Tried some options with closing ws client right after establishing connection, sending some crappy staff into it - nothing caused this bug to appear.
Anyway it's present and needed to be fixed.
Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@mcollina
Copy link
Collaborator

Can you add a test that directly call the Subscriber? I think that should be possible.

@SkeLLLa
Copy link
Contributor Author

SkeLLLa commented Dec 18, 2019

@mcollina test added.

Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 25dbe74 into mercurius-js:master Dec 19, 2019
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