Skip to content

Conversation

scottinet
Copy link
Contributor

  • created the renewAllSubscriptions internal function and replaced all subscriptions renewals by a call to this function, to avoid repetition of code
  • created the emitEvent internal function and replaced all event emissions by a call to this function, to avoid repetition of code
  • removed loginStrategy, loginCredentials and loginExpiresIn Kuzzle properties.
  • The Kuzzle object does not login automatically anymore. An explicit call to Kuzzle.login() must be performed
  • Once successfully logged in, all subscriptions are now automatically renewed. This is to avoid having subscriptions not getting notifications anymore because of a token expiration.
  • Added a timer in the KuzzleRoom object, in order to avoid renewals to be executed successively. For instance, when connecting manually to Kuzzle, this call chain would perform 1 unnecessary renewal:
var room = kuzzle
  .dataCollectionFactory('foo', 'bar')
  .subscribe({}, function (err, res) { /* */ });

kuzzle
  .connect()    // <= will trigger a susbcriptions renewal
  .login(...);  // delayed after connect() succeeds. Then triggers a subscriptions renewal.

scottinet added a commit that referenced this pull request Jan 29, 2016
Successful logins now renew subscriptions
@scottinet scottinet merged commit 03b7d75 into master Jan 29, 2016
@scottinet scottinet deleted the KUZ379_loginResubscribe branch January 29, 2016 09:33
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.

1 participant