Skip to content

Conversation

scottinet
Copy link
Contributor

@scottinet scottinet commented Nov 29, 2017

⚠️ depends on #260 ⚠️

Event 'tokenExpired'

The unsetJwt method being public, it's not a good idea to make it trigger the tokenExpired event when called. Furthermore it's not its role to propagate that event.

This SDK makes the Kuzzle main object contructor itself subscribe to the network layer tokenExpired event and takes responsability to propagate it. The event itself is also propagated by the generic notification callback layer, in case the token expires while no new request is made

'disconnected' state

Upon disconnection, both socket.io and websocket protocol implementations set the network set to disconnected instead of offline, making all further calls to kuzzle.connect() impossible with that instance

@scottinet scottinet self-assigned this Nov 29, 2017
@codecov-io
Copy link

codecov-io commented Nov 29, 2017

Codecov Report

Merging #261 into 6.x will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              6.x     #261      +/-   ##
==========================================
+ Coverage   98.25%   98.25%   +<.01%     
==========================================
  Files          17       17              
  Lines        2125     2126       +1     
  Branches      618      618              
==========================================
+ Hits         2088     2089       +1     
  Misses         37       37
Impacted Files Coverage Δ
src/Kuzzle.js 97.46% <100%> (ø) ⬆️
src/networkWrapper/protocols/websocket.js 100% <100%> (ø) ⬆️
src/networkWrapper/protocols/socketio.js 100% <100%> (ø) ⬆️

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 e55b85c...7c5a1fe. Read the comment docs.

@scottinet scottinet changed the title Fix tokenExpired event being triggered by unsetJwt Fix network events Dec 4, 2017
@benoitvidis benoitvidis merged commit 45159ff into 6.x Dec 4, 2017
@benoitvidis benoitvidis deleted the fix_tokenexpired_event branch December 4, 2017 15:27
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.

4 participants