-
Notifications
You must be signed in to change notification settings - Fork 17
6.0.0 proposal #377
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
6.0.0 proposal #377
Conversation
* Network wrappers refactoring: move persistent connection management from Kuzzle root component to Network wrappers * Network wrappers refactoring: * remove isValid() (obsolete method) * move queue management from Kuzzle to network wrappers * fix unit tests * some boyscout improvements on unit tests. * rename `jwtToken` => `jwt` * Network wrappers refactoring: add netowk events propagation * Use ES6 syntax for network wrappers + use Babel for browsers * Refactor Room management - step 1 * fix linter * improve code coverage * fix KuzzleEventEmitter methods signatures, to be consistant with NodeJS `event` specitications: emit should return a boolean value. (see https://nodejs.org/api/events.html#events_emitter_emit_eventname_args ) * Refactor Kuzzle constructor and methods unit tests * readd Collection.room method + fix unit tests for Collection class * move `requestHistory` from Kuzzle to network wrappers * remove all room listeners when unsuscribing * nitpicking * * change signature for network.unsubscribe (use the channel name instead of the whole room) * add unit-tests for network.subscribe and network.unsubscribe methods * Refactor Room Management * improve test coverage * add `options` parameter to Room.subscribe * Apply remarks from @scottinet + add 'use strict' in pure ES6 classes * Allow Kuzzle.query to be called with empty `query` argument to enable calls like `kuzzle.queryPromise({controller: 'server', action: 'healthCheck'}).then(...);` * Allow `Collection.publishMessage` method to be promisified * add `options` parameter to Room.unsubscribe * rename `wrappers` => `protocols` * fix remarks from @dbengsch
merge from 5.x
Harmonize values returned by memory storage functions
* set exposed properties as described in the specs * remove the "headers" property * change kuzzle.offlineQueue to read-only * update license file
* set exposed properties as described in the specs * remove the "headers" property * change kuzzle.offlineQueue to read-only * update license file * simplify room subscription workflow * fix #53 * remove unused unsubscribe option
Fix network events
## What does this PR do? Don't send the jwt when doing a `login` action. This prevent to be able to do a login after a `tokenExpired` happen without resetting the jwt (kuzzle.jwt = null)
# Description The Kuzzle event `tokenExpired` should be triggered in two cases: * when a request response contains `tokenExpired` error * whenever a `TokenExpired` realtime event is received The current SDK version only handles the first case, which causes many problems for clients using realtime, such as: * realtime callbacks are not cleared, meaning clients handling manually the event have more and more of the same callbacks registered (and invoked) * the `tokenExpired` event is not triggered upon receiving a TokenExpired realtime notification * the JWT is not cleared upon receiving a TokenExpired realtime notification This PR adds a proper TokenExpired realtime notification handling, ensuring that all the above problems are solved. * [realtime] properly handle tokenExpired events * [tokenExpired] clear the JWT upon receiving a TokenExpired notification
When someone instantiate Kuzzle, we start to add listener on events. With SocketIO protocol, these events must be added also on the socket but the socket itself is instantiated only after a call to connect
Save Kuzzle API routes in a json file to permit the HTTP protocol to not have to performs request on Kuzzle to fetch all available vanilla routes.
# Description On a websocket connection error, the error thrown by the SDK has the following message: `[object Object]` This is because on a connection error, `ws` sends a complex object, but our error handler processes it as if it's a string. # How to test it Run this snippet: ```js const {Kuzzle, WebSocket} = require('kuzzle-sdk'); const ws = new WebSocket('localhost'), kuzzle = new Kuzzle(ws); kuzzle.connect().catch(err => console.error(err)); kuzzle.disconnect(); ``` Before this PR, this prints: ``` Error: [object Object] ... stack trace ... ``` With this PR: ``` Error: WebSocket was closed before the connection was established ... stack trace ... ``` * [websocket] fix error object on connection error * [ws] do not overwrite an existing stacktrace
Adds a `KuzzleError` that extends `Error` class. The `KuzzleError` contains additional properties sent by Kuzzle: `status` and `stack`.
Following the Travis documentation: https://docs.travis-ci.com/user/deployment/npm/#note-on-gitignore We should add an empty `.npmignore` to push dist folder on NPMJS when releasing a new version.
Codecov Report
@@ Coverage Diff @@
## master #377 +/- ##
==========================================
- Coverage 98.34% 96.71% -1.64%
==========================================
Files 17 30 +13
Lines 2120 1431 -689
==========================================
- Hits 2085 1384 -701
- Misses 35 47 +12
Continue to review full report at Codecov.
|
We found that the README.md file was too complicated and used code duplicated from our documentation. I will take care of updating and simplifying it at the same time. |
There it is the new Readme! Hope you'll enjoy it 🙂 |
bbdd079
to
c532349
Compare
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.
Just add newline for readability
Co-Authored-By: alexandrebouthinon <[email protected]>
6.0.0 (2019-02-21)
Breaking changes
stopTime
as optional argument forgetStatistics()
(ballinette)Bug fixes
New features
Enhancements
stopTime
as optional argument forgetStatistics()
(ballinette)Others