Skip to content

Logout button triggers lots of recomputes #340

@m-mujica

Description

@m-mujica

When logout is clicked, there is a compute that cycles a lot times (happens in dev, and with optimized build).

If you have the dev-tools open you can see it hitting the else in the code below a bunch of times:

// can-connect-feathers/session/session
getData: function() {
    return new Promise(function(resolve, reject) {
      var tokenLocation = options.tokenKey || options.cookie;
      if (hasValidToken(tokenLocation) && !window.doneSsr) {
        feathersClient
          .authenticate()
          .then(function(data) {
            var payload = decode(data.accessToken);
            return resolve(payload);
          })
          .catch(reject);
      } else {
        reject(new errors.NotAuthenticated("Not Authenticated"));
      }
    });
  }

I added a console.log before the rejection and:

screen shot 2017-10-05 at 11 36 57

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions