Skip to content
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

WebClient onStatus order changed #23880

Closed
trecloux opened this issue Oct 28, 2019 · 2 comments
Closed

WebClient onStatus order changed #23880

trecloux opened this issue Oct 28, 2019 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Milestone

Comments

@trecloux
Copy link

trecloux commented Oct 28, 2019

Affects: 5.2.0

Hi all,

It looks like the onStatus custom error predicates are now evaluated in the inverted order compared to version 5.1.x

Using the WebClient this way:

webClient.
// ...
  .onStatus(
     HttpStatus.BAD_REQUEST::equals,
     res -> res.bodyToMono(Void.class).then(Mono.just(new SpecificException()))
  )
  .onStatus(
    HttpStatus::isError,
    res -> res.bodyToMono(Void.class).then(Mono.just(new GenericException())))
   )

// ...

Using 5.1.0 first onStatus was evaluated first, using version 5.2.0 with the same WebClient usage, last onStatus is evaluated first and behavior is significantly changed.

This behavior change was introduced in commit a9b3d95

If this onStatus evaluation order is not guaranteed, I think that this should be documented.

I can submit a documentation or a fix pull request.

Thomas

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 28, 2019
@jhoeller jhoeller added this to the 5.2.1 milestone Oct 31, 2019
@jhoeller jhoeller added in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression labels Oct 31, 2019
@snicoll snicoll removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 31, 2019
@rstoyanchev rstoyanchev self-assigned this Oct 31, 2019
@poutsma poutsma assigned poutsma and unassigned rstoyanchev Oct 31, 2019
@rstoyanchev rstoyanchev assigned rstoyanchev and unassigned poutsma Oct 31, 2019
pull bot pushed a commit to scope-demo/spring-framework that referenced this issue Oct 31, 2019
@trecloux
Copy link
Author

trecloux commented Oct 31, 2019

Thanks a lot team.

@rstoyanchev
Copy link
Contributor

Thanks for the offer to send a PR but I wanted to make sure this makes 5.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

6 participants