question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_userManager.AddTokenValidityKeyAsync performance issue

See original GitHub issue

Related: https://github.com/aspnetzero/aspnet-zero-core/issues/2926

No filters applied in AbpUserTokens query causing code to load all records. 9520 records in my local db and can’t imagine the load on production.

image

Possible fixes:

  • Delete old tokens
  • Apply filters to query

The problem causing code: TokenAuthController > CreateJwtClaims

await _userManager.AddTokenValidityKeyAsync(
                user,
                tokenValidityKey,
                DateTime.UtcNow.Add(expiration.Value)
            );

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ismcagdascommented, Jan 22, 2020

@maliming yes, we can do that optimization 👍 .

0reactions
ismcagdascommented, Feb 27, 2023

We have introduced AddTokenValidityKeyAsync to AbpUserManager which uses UserIdentifier, see https://github.com/aspnetboilerplate/aspnetboilerplate/commit/28df0afa07786d61d7ed774a074f40c6645acf99.

This method can be used during token generation to store User’s new token instead of the old one.

Now, AbpUserManager requires IRepository<UserToken, long> into its constructor.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Poor performance during role deletion #9167 | Support Center
It seems like the call to UserManager.RemoveFromRoleAsync decreases in performance when there are more than a small number of users assigned ...
Read more >
Performance issue while loading website #8553
I am using ASP.NET Core, Angular and the version is 7.2.0 and trying to troubleshoot perfroamce issue while laoding application homepage. As ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found