Skip to content

Fix EvaluationContextExtension filter fall-through in ReactiveExtensionAwareEvaluationContextProvider #2393

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

Closed
wants to merge 1 commit into from

Conversation

dsbecker
Copy link
Contributor

When a ReactiveMongoRepository uses an @query annotation, I get a java.lang.IllegalStateException: Unsupported extension type: org.springframework.data.jpa.repository.support.JpaEvaluationContextExtension thrown by ReactiveExtensionAwareEvaluationContextProvider after upgrading to spring-data-commons 2.4x+. It appears that the if (it instanceof EvaluationContextExtension) { clause is missing a return Mono.empty(); when extensionFilter.test(information) returns false like if (it instanceof ReactiveEvaluationContextExtension) { has. This allows it to fall through and return the Mono.error(...).

Closes #2392

When a ReactiveMongoRepository uses an @query annotation, I get a java.lang.IllegalStateException: Unsupported extension type: org.springframework.data.jpa.repository.support.JpaEvaluationContextExtension thrown by ReactiveExtensionAwareEvaluationContextProvider after upgrading to spring-data-commons 2.4x+. It appears that the if (it instanceof EvaluationContextExtension) { clause is missing a return Mono.empty(); when extensionFilter.test(information) returns false like if (it instanceof ReactiveEvaluationContextExtension) { has. This allows it to fall through and return the Mono.error(...).

Closes #2392
@pivotal-cla
Copy link

@dsbecker Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@dsbecker Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 24, 2021
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 12, 2021
@mp911de mp911de changed the title Fix java.lang.IllegalStateException: Unsupported extension type: ... Fix EvaluationContextExtension filter fall-through in ReactiveExtensionAwareEvaluationContextProvider Jul 12, 2021
mp911de pushed a commit that referenced this pull request Jul 12, 2021
…onAwareEvaluationContextProvider.

Using JpaEvaluationContextExtension with reactive infrastructure in place, ReactiveExtensionAwareEvaluationContextProvider can lead to IllegalStateException if the desired extension doesn't match the predicate instead of being silently dropped.

Closes #2392
Original pull request: #2393.
mp911de added a commit that referenced this pull request Jul 12, 2021
Add unit tests.

See #2392
Original pull request: #2393.
@mp911de
Copy link
Member

mp911de commented Jul 12, 2021

Thank you for your contribution. That's merged, polished, and backported now.

mp911de pushed a commit that referenced this pull request Jul 12, 2021
…onAwareEvaluationContextProvider.

Using JpaEvaluationContextExtension with reactive infrastructure in place, ReactiveExtensionAwareEvaluationContextProvider can lead to IllegalStateException if the desired extension doesn't match the predicate instead of being silently dropped.

Closes #2392
Original pull request: #2393.
mp911de added a commit that referenced this pull request Jul 12, 2021
Add unit tests.

See #2392
Original pull request: #2393.
mp911de pushed a commit that referenced this pull request Jul 12, 2021
…onAwareEvaluationContextProvider.

Using JpaEvaluationContextExtension with reactive infrastructure in place, ReactiveExtensionAwareEvaluationContextProvider can lead to IllegalStateException if the desired extension doesn't match the predicate instead of being silently dropped.

Closes #2392
Original pull request: #2393.
mp911de added a commit that referenced this pull request Jul 12, 2021
Add unit tests.

See #2392
Original pull request: #2393.
@mp911de mp911de closed this Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
4 participants