- 
                Notifications
    You must be signed in to change notification settings 
- Fork 17
Fix duplicate subscriptions on reconnect #437
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
Fix duplicate subscriptions on reconnect #437
Conversation
| Codecov Report
 @@            Coverage Diff             @@
##           master     #437      +/-   ##
==========================================
- Coverage   96.15%   96.07%   -0.09%     
==========================================
  Files          33       33              
  Lines        1612     1630      +18     
==========================================
+ Hits         1550     1566      +16     
- Misses         62       64       +2
 Continue to review full report at Codecov. 
 | 
| Keeping in wip for the time being: 
 | 
3f445cb    to
    63965b8      
    Compare
  
    | Removing wip: The attached gist failure is due to a bug in Kuzzle and addressed here | 
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.
Either target 6-dev or bump version numbers+explain why this is a hotfix.
| @scottinet You're right. The fixed behaviours have been there for a while now. I think we can wait for the next release. | 
# [6.2.2](https://github.com/kuzzleio/sdk-javascript/releases/tag/6.2.2) (2019-09-11) #### Bug fixes - [ [#437](#437) ] Fix duplicate subscriptions on reconnect ([benoitvidis](https://github.com/benoitvidis)) #### Enhancements - [ [#439](#439) ] Add timeout support to Http protocol ([Aschen](https://github.com/Aschen)) ---
What does this PR do?
When the jwt expires, all subscriptions are reset. Users need to manually resubscribe on the
tokenExpiredevent.This PR attempts to fix the following situations:
tokenExpiredandautoResubscribeis on and if Kuzzle client gets disconnected and the token expires during the disconnection, when the client is reconnected, the subscriptions are added twice.tokenExpiredcollisions can mess the attached eventsUnhandledRejectionissued by a failing autoresubscribe if the token expired in the meantimeChanges
realtimecontroller cleans up the rooms ondisconnectandnetworkErrorevents to avoid some leaks.tokenExpiredevent is now handled at Kuzzle level anddiscardedevent.