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

Clear outgoing on close. #951

Closed
wants to merge 1 commit into from

Conversation

redboltz
Copy link
Contributor

If outgoing was is cleared on close from the server, there is no
chance to call callbacks in outgoing. outgoing entries exist
invalidly after closing.

That prevents end function. In the end function, if force is not
set and outgoing exists, then wait outgoingEmpty event. However,
the event never happen because previous entries are not removed.

This update fixes the problem.

If `outgoing` was is cleared on close from the server, there is no
chance to call callbacks in `outgoing`. `outgoing` entries exist
invalidly after closing.

That prevents `end` function. In the `end` function, if `force` is not
set and `outgoing` exists, then wait `outgoingEmpty` event. However,
the event never happen because previous entries are not removed.

This update fixes the problem.
@codecov
Copy link

codecov bot commented May 24, 2019

Codecov Report

Merging #951 into master will decrease coverage by 45.65%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #951       +/-   ##
===========================================
- Coverage   93.66%   48.01%   -45.66%     
===========================================
  Files           8        8               
  Lines         932      933        +1     
  Branches      243      243               
===========================================
- Hits          873      448      -425     
- Misses         59      485      +426
Impacted Files Coverage Δ
lib/client.js 48.74% <100%> (-48.01%) ⬇️
lib/connect/tls.js 21.05% <0%> (-73.69%) ⬇️
lib/connect/ws.js 22.91% <0%> (-54.17%) ⬇️
lib/store.js 53.57% <0%> (-41.08%) ⬇️
lib/connect/index.js 48.83% <0%> (-38.38%) ⬇️
lib/validations.js 72.22% <0%> (-27.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84ca344...2cb1ca4. Read the comment docs.

@redboltz
Copy link
Contributor Author

I forgot removing only on test. I will fix it.

@redboltz
Copy link
Contributor Author

For qos1 and qos2 publish message, clearing outgoing is bad.
Because callbacks in outgoing should be called after the client re-connect and resend publish messages.

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.

None yet

1 participant