-
Notifications
You must be signed in to change notification settings - Fork 17
Release 7.7.2 #652
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
Merged
Merged
Release 7.7.2 #652
Conversation
This file contains hidden or 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
When requests are queued, there are 2 constructor options that can lead to abort them before they can be sent to Kuzzle: queueTTL: if set to a value larger than 0, queued requests can expire queueMaxSize: if set to a value larger than 0, the queue has a maximum number of requests it can hold. If reached, older requests are aborted to make place for newer ones When requests are aborted because of those configurations, an offlineQueuePop event is emitted, but: the invalid argument is provided, making the event deliver an undefined payload the promise associated to the aborted request is not rejected, making clients await indefinitely for them This PR fixes these issues, and add the missing unit tests that should have caught these problems earlier. Other changes the offlineQueuePop event emitted when the queue is being played does not deliver the right payload. The entire queued object is delivered (containing the queued request and additional information about it), instead of just the request, as per the documentation. So, I fixed that too.
This PR fixes a Race Condition that was occuring within the Heartbeat causing the SDK to think the connection was lost and making him engage the reconnection protocol which was causing the SDK to create multiple Websocket connection even though the previous connections were fine. This is a serious problem that could cause applications to be overloaded with Websocket connections and can saturate the Event Loop or the limit of Websocket connections defined by the browsers. What has been done: - Avoid creating a Timeout in the the ping Interval since they had the same amount of time before execution and that caused a race condition, we now only have an Interval that checks if there has been a pong since the last cycle, if not throw an Error, if there was a pong since the last ping cycle do another ping. - Correct tests to verify the new behaviour - Fixed: the ping Interval was not cleared when `websocket.close` was called - Ensures that the websocket connection is closed on timeout before engaging the reconnection protocol otherwise if this was a false positive because Kuzzle could not respond in time we would have 2 connection opened. - Ensures that the previous interval is cleared before creating a new one
When the SDK reconnect to Kuzzle, it trigger the `reconnected` event. The Realtime controller will try to resubscribe when this event is triggered. If the token had expired, then the Realtime controller will try to resubscribe with no authentication and thus the subscriptions request may fail. This PR include a new `authenticator` property, this property should contain a function that authenticate the SDK (with `auth.login` for example). The SDK will call the function before emitting the reconnected event, if the SDK was authenticated and cannot re-authenticate then the `reconnected` event will not be emitted and the SDK will be in the `disconnected` state. A new `reconnectionError` has been added and is triggered when the reconnection has failed
Codecov Report
@@ Coverage Diff @@
## master #652 +/- ##
==========================================
+ Coverage 85.62% 86.16% +0.53%
==========================================
Files 36 36
Lines 1635 1662 +27
Branches 297 302 +5
==========================================
+ Hits 1400 1432 +32
+ Misses 175 173 -2
+ Partials 60 57 -3
Continue to review full report at Codecov.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
7.7.2 (2021-07-21)
Bug fixes
Enhancements