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

Update from upstream #1

Merged
merged 574 commits into from
Feb 7, 2020
Merged

Update from upstream #1

merged 574 commits into from
Feb 7, 2020

Conversation

imZack
Copy link
Owner

@imZack imZack commented Feb 7, 2020

No description provided.

mcollina and others added 30 commits June 6, 2017 08:23
Fixed regression introduced in #624.
Added checks for double subscription issue
the default value must be set for an empty options parameter
TypeScript: QoS should be mandatory
[WIP]Add basic compile/connect/sub/pub TypeScript test
Removed `delByMessageId` and use `del`.
mcollina and others added 29 commits September 7, 2018 15:48
Delayed emit timing of `connect` event.
Added new callback `cbStorePut` to `publish()`. `cbStorePut` is called when message is put into `outgoingStore`.

Problem:
When disconnection occures right after `publish()` but `callback` is not called, then reconnect, client can't know if the message is completely stored into `outgoingStore`.

Outcome:
This commit fixes above problem.
Client can know that message has been put into `outgoingStore` when `cbStorePut` is called.
Add new callback called when message is put into `outgoingStore`.
fix properties mqtt 5 in subscribe
Update TypeScript declaration files for `cbStorePut`.
* add support for Ali Mini Program

* remove test for wx and ali Mini Program

* refactor lib/connect/ali.js

* rewrite wx.js

* fix wx.js

* remove unuse console, and fix connect/index.js for alis

* revert ws.js

* fix ali.js

* remove weapp-test script in package.json

* fix README.md

* fix ali.js to adapt IDE
* fix: delete completed incoming QOS 2 messages

* delay deleting incoming QOS 2 messages from store until PUBCOMP has been sent

* verify handshake order of QOS 2

* ensure QOS 2 message is only handled once, when sending pubcomp fails and multiple pubrel are received

* add test to check incoming store is empty after QOS 2 handshake
* Updated some dependencies, removed old node versions from .travis.yml

* Fix #901 errors.

Replace echo stream close implementation.
* Fix publish interrupt during stored packets processing.

If `publish()` is called during stored packets processing, store the packet id into `packetIdsDuringStoreProcessing` kvs. The key is packet id and the value is boolean (true: prossesed, false: not processed). At this time, the value is false. If the packet is actually sent, the value is set to true.

When stream process reaches the end, check all of `packetIdsDuringStoreProcessing` are processed, if it doens't, try again flowing process from the beginning. In this process, already processed (but not removed yet because puback is not receieved) packets should be skipped. In order to do that, check  `packetIdsDuringStoreProcessing` value. If it is true, skip it.

* Add '_' prefix to internal properties.

* Refactoring to increase codecov.
* add support for Ali Mini Program

* remove test for wx and ali Mini Program

* refactor lib/connect/ali.js

* rewrite wx.js

* fix wx.js

* remove unuse console, and fix connect/index.js for alis

* revert ws.js

* fix ali.js

* remove weapp-test script in package.json

* fix README.md

* fix ali.js to adapt IDE

* fix ali.js and wx.js

* fix wx.js

* fix: change let to var
* perform nextTick work only if work needs to be done, call done() immediately if not.

* check if done() is valid
* resubscribe mqtt5 fix

* for loop rebase
* process disconnect packet w/o full destroy the connection

* Update README.md

Co-Authored-By: Matteo Collina <matteo.collina@gmail.com>
* Fixed #952.

Conditional flush `outgoing` on close.

Scenario:
1. The client connect to the server.
2. The client sends subscribe to the server.
3. The server destroys the client connection before suback sending.
4. The client detect `close` event, then reconnects to the server.

At the step4, `outgoing` still stored the callback for
subscribe. However, it has never called because server doen't send
corresponding suback.
The same thing happens on unsubscribe.

So I defined subscribe/unsubscribe as volatile.
The volatile type of `outgoing` entries should be cleared when `close`
from the server is detected.

On the contrary, QoS1 and QoS2 publish is not volatile. Because they are
resent after reconnection. And then, callback in the `store` is
called. This behavior shouldn't be changed.

So I added `volatile` flag to `outgoing` element.

* Fixed cb accessing code.

If `outgoing[mid]` doesn't match, then accessing `outgoing[mid].cb`
causes `Cannot read property` error. So added checking code.

Fixed outgoing assignment at `_onConnect` function.
* fix: set default servername in tls connect

* fix: unit tests for tls servername option
Correct "nedbb" typo in README.md
* Update README.md

* Update README.md
@imZack imZack merged commit 04e481d into imZack:master Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet