Skip to content

Optimize token revocation process in EntityFramework stores #2360

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

Merged
merged 2 commits into from
Jul 5, 2025

Conversation

syntaximus
Copy link
Contributor

I think it's possible to create a scenario where someone intentionally uses the same token twice to trigger the revocation process, leading to a large number of updates and excessive resource usage.

This pull request optimizes the token revocation process by filtering out already revoked tokens, reducing memory usage and unnecessary updates. The current implementation loads all tokens into memory and manually updates each one, which can lead to excessive data being loaded and a high number of unnecessary update operations. By filtering out already revoked tokens, we reduce memory usage and improve performance.

@kevinchalet
Copy link
Member

Thanks for your PR!

That's indeed a good idea. Can you just split the where conditions you've added so they appear on their own lines? Once it's done, I'll merge this PR and make sure it's part of the 7.0 release that's about to ship.

Cheers.

@syntaximus
Copy link
Contributor Author

Thanks for your PR!

That's indeed a good idea. Can you just split the where conditions you've added so they appear on their own lines? Once it's done, I'll merge this PR and make sure it's part of the 7.0 release that's about to ship.

Cheers.

Thank you for your feedback! I've made the changes as per your suggestions and updated the pull request.

@kevinchalet kevinchalet merged commit fc8a738 into openiddict:dev Jul 5, 2025
6 checks passed
@kevinchalet
Copy link
Member

Merged. Congrats for your first contribution to OpenIddict! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants