Skip to content

Make IQueryExpressionInterceptor an ISingletonInterceptor #36128

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roji
Copy link
Member

@roji roji commented May 23, 2025

Fixes #36127

@AndriySvyryd am not too familiar with the IISingleInterceptor machinery, can you confirm this is the right approach?

@roji roji requested a review from AndriySvyryd May 23, 2025 11:15
@roji roji requested a review from a team as a code owner May 23, 2025 11:15
@roji roji enabled auto-merge (squash) May 23, 2025 11:15
@roji roji force-pushed the QueryInterceptor branch 2 times, most recently from eb4348d to 9b9aac6 Compare May 23, 2025 12:27
[InlineData(false, true)]
[InlineData(true, true)]
public virtual async Task Intercept_query_passively(bool async, bool inject)
[MemberData(nameof(IsAsyncData))]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndriySvyryd note that now that the interceptor is a singleton, we can't test "app interceptor" setup since the tests use an externally-provided internal service provider. It seems like the general interceptor machinery is already well-covered via other non-singleton interceptors that we can not also exercise it here.

@roji roji force-pushed the QueryInterceptor branch from 9b9aac6 to 9958ab9 Compare May 23, 2025 14:10
@roji roji force-pushed the QueryInterceptor branch from 9958ab9 to f3fde5c Compare May 23, 2025 15:24
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.

IQueryExpressionInterceptor leaks across contexts, leading to incorrectly-used cached queries
1 participant