Skip to content

Conversation

Aschen
Copy link
Contributor

@Aschen Aschen commented Nov 5, 2019

6.2.6 (2019-11-05)

Enhancements

  • [ #456 ] Do not try to reconnect if the browser is offline (scottinet)
  • [ #451 ] Remove local checks for arguments (Aschen)

Aschen and others added 6 commits October 7, 2019 10:41
## What does this PR do?

`v6` version of #450 

Remove the local check of the arguments since now we have specifics errors code sent by Kuzzle.

### Other changes

 - Add error codes `id` and `code` properties to `KuzzleError`
# Description

If `autoReconnect` is true, the SDK tries to reconnect every `reconnectionDelay` milliseconds.

If executed within a browser, the SDK can know if the browser has access to some kind of network: if it's marked as "offline", then there is no point retrying to connect, and this might even be harmful in some situations. For instance, browsers switch to offline if a laptop lid is closed, or if a mobile phone screen is turned off. So continuing to connect is just a useless consumption of battery power.

This PR stops the reconnection loop and instead waits for the browser to switch to "online" again before resuming its reconnection attempts.
@Aschen Aschen added the release label Nov 5, 2019
@codecov
Copy link

codecov bot commented Nov 5, 2019

Codecov Report

Merging #459 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #459      +/-   ##
==========================================
- Coverage   96.03%   96.03%   -0.01%     
==========================================
  Files          33       33              
  Lines        1641     1362     -279     
==========================================
- Hits         1576     1308     -268     
+ Misses         65       54      -11
Impacted Files Coverage Δ
src/controllers/index.js 100% <ø> (+2.7%) ⬆️
src/controllers/collection.js 100% <ø> (+5.19%) ⬆️
src/controllers/document.js 96% <ø> (+1.08%) ⬆️
src/controllers/realtime/index.js 97.77% <ø> (-0.64%) ⬇️
src/controllers/security/index.js 99.25% <ø> (-0.33%) ⬇️
src/KuzzleError.js 100% <100%> (ø) ⬆️
src/controllers/auth.js 92.59% <100%> (-0.27%) ⬇️
src/protocols/abstract/realtime.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 316cd5e...ddb15e9. Read the comment docs.

@Aschen Aschen merged commit 0bc5a45 into master Nov 5, 2019
@Aschen Aschen deleted the 6.2.6-proposal branch November 5, 2019 04:55
@scottinet scottinet mentioned this pull request Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants