Skip to content

Provide method with ContextView instead of Context in ServerWebExchangeContextFilter #29691

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

Conversation

singhbaljit
Copy link
Contributor

@singhbaljit singhbaljit commented Dec 15, 2022

Use ContextView in ServerWebExchangeContextFilter#get.

  • Context is a subclass of ContextView; hence, this is a non-breaking change.
  • It makes the convenience method more convenient because Mono#transformDeferredContextual and Mono#deferContextual provide ContentView instance. This avoids the need for a clunky cast or the unnecessary .map(Context::of).

@singhbaljit singhbaljit force-pushed the exchange_context_filter branch from 59e0bf3 to d89616a Compare December 15, 2022 04:22
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 15, 2022
@singhbaljit
Copy link
Contributor Author

singhbaljit commented Dec 15, 2022

Tagging @rstoyanchev since you wrote the class originally.

@singhbaljit singhbaljit changed the title Use ContextView in ServerWebExchangeContextFilter Use ContextView in ServerWebExchangeContextFilter Dec 15, 2022
@rstoyanchev rstoyanchev added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Jan 24, 2023
Copy link
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

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

It is a reasonable and necessary change, and although it is source compatible, it is not binary compatible. We can instead introduce a new method getExchange(ContextView) and deprecate the existing one, which would provide a path to migrate.

Would you like to make this adjustment, or otherwise we can also take it from here?

@rstoyanchev rstoyanchev added this to the 6.0.6 milestone Feb 20, 2023
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 20, 2023
@rstoyanchev rstoyanchev changed the title Use ContextView in ServerWebExchangeContextFilter Provide method with ContextView instead of Context in ServerWebExchangeContextFilter Feb 20, 2023
@rstoyanchev rstoyanchev self-assigned this Feb 20, 2023

Unverified

This user has not yet uploaded their public signing key.
@singhbaljit singhbaljit force-pushed the exchange_context_filter branch from d89616a to ec41753 Compare February 20, 2023 16:10
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: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants