-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore: more code cleanup surrounding client.end callbacks #1629
Merged
robertsLando
merged 5 commits into
mqttjs:main
from
BertKleewein:more-client-end-test-changes
Jul 10, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d56caac
chore: more code cleanup surrounding client.end callbacks
fec1dc6
add missing close callback
4e1fdbb
fix cleanup in mqtt5 client tests
1a7a5bb
Merge branch 'main' into more-client-end-test-changes
BertKleewein d1d2383
Merge branch 'main' into more-client-end-test-changes
robertsLando File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 use mqttjs in lot of my projects and this happend to me too, I always create a MqttClient wrapper library that handles all client stuff, this is how I handle the close usually: https://github.com/zwave-js/zwave-js-ui/blob/master/lib/MqttClient.ts#L154. I think this could happen when for some reason underlig socket is already closed/destroyed or when store cannot be closed for some reason
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.
No clue if this could help: #713
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 merged #713 into a local branch and it didn't resolve this issue. It is an interesting change though.
One of my goals with these test changes is to get the behavior of
client.end
well tested before we make any changes to it. Right now, it's just too hard to reason about howclient.end
might behave and I'm afraid to make any changes to it.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 agree! Tests are essentials if we want to make improvements to the code