Skip to content

Conversation

alexandrebouthinon
Copy link
Member

6.0.0 (2019-02-21)

Breaking changes

Bug fixes

  • [ #373 ] WebSocket: fix error object on connection error (scottinet)
  • [ #369 ] Addlistener after connect (Aschen)
  • [ #374 ] Properly handle tokenExpired events (scottinet)
  • [ #372 ] Don't send jwt when doing the login action (jenow)
  • [ #359 ] Fixed call to checkToken after reconnection (xbill82)
  • [ #349 ] [build] Update webpack build config to fix raw web usage (Njuelle)
  • [ #345 ] Fix 343 unhandled rejection on connect (Aschen)
  • [ #359 ] Fixed call to checkToken after reconnection (xbill82)
  • [ #355 ] React native compatibility (scottinet)
  • [ #349 ] [build] Update webpack build config to fix raw web usage (Njuelle)
  • [ #345 ] Fix 343 unhandled rejection on connect (Aschen)
  • [ #338 ] Fix undefined "volatile.sdkInstanceId" in sent queries (scottinet)
  • [ #337 ] 'ms:sort' needs its options in the request's body (scottinet)
  • [ #327 ] Fix searchResult next (benoitvidis)
  • [ #333 ] Kzl 791 fix exception when publish msg with rest api (etrousset)
  • [ #332 ] Realtime: fix bug (etrousset)
  • [ #330 ] Fix null id in arguments (Aschen)
  • [ #320 ] Fix return value for index#list and index#mDelete (Aschen)
  • [ #315 ] Fix jwt in query (jenow)
  • [ #315 ] Fix jwt in query (jenow)
  • [ #312 ] Rename deleteSpecification to deleteSpecifications (Aschen)
  • [ #286 ] Volatile data can also be null (scottinet)
  • [ #269 ] V6: Option "subscribeToSelf" using volatile data (scottinet)
  • [ #263 ] Return result in case of partial errors for mupdate/mcreate/mdelete methods (ballinette)

New features

  • [ #353 ] Add method to use custom controllers in the SDK (Aschen)
  • [ #353 ] Add method to use custom controllers in the SDK (Aschen)
  • [ #271 ] HTTP Protocol suport (ballinette)

Enhancements

Others


Gilles Ballini and others added 30 commits September 29, 2017 15:32
* 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
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
scottinet and others added 15 commits February 14, 2019 10:20
## 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-io
Copy link

codecov-io commented Feb 21, 2019

Codecov Report

Merging #377 into master will decrease coverage by 1.63%.
The diff coverage is 96.58%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/controllers/searchResult/document.js 100% <100%> (ø)
src/controllers/searchResult/user.js 100% <100%> (ø)
src/controllers/base.js 100% <100%> (ø)
src/controllers/security/user.js 100% <100%> (ø)
src/controllers/searchResult/role.js 100% <100%> (ø)
src/controllers/server.js 100% <100%> (ø)
src/controllers/searchResult/specifications.js 100% <100%> (ø)
src/protocols/abstract/realtime.js 100% <100%> (ø)
src/controllers/security/index.js 100% <100%> (ø)
src/KuzzleError.js 100% <100%> (ø)
... and 47 more

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 35bd1ee...5acdeb7. Read the comment docs.

@alexandrebouthinon
Copy link
Member Author

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.

@alexandrebouthinon
Copy link
Member Author

There it is the new Readme! Hope you'll enjoy it 🙂

Copy link
Contributor

@Aschen Aschen left a 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]>
@alexandrebouthinon alexandrebouthinon merged commit 888bf6a into master Feb 22, 2019
@alexandrebouthinon alexandrebouthinon deleted the 6.0.0-proposal branch February 22, 2019 10:03
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.

9 participants