fix: register the resync filter only when spring-web is present - #415
Draft
totally-not-ai[bot] wants to merge 2 commits into
Draft
totally-not-ai[bot] wants to merge 2 commits into
totally-not-ai[bot] wants to merge 2 commits into
Conversation
The starter compiles against SpringResyncDetectionFilter, which extends OncePerRequestFilter. It used to get spring-web transitively through vaadin-spring, but vaadin-spring 25.4 declares spring-webmvc as provided, so the starter no longer compiles against Flow 25.4. Co-Authored-By: Claude Opus 5.5 <[email protected]>
spring-web is an optional dependency of the starter, so the filter bean that depends on OncePerRequestFilter lives in a nested configuration guarded by @ConditionalOnClass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
|
This is probably not needed at all if the related Flow PR is merged |
Contributor
Author
|
@Artur- Agreed. If vaadin/flow#25960 merges, the kit can count resent, resync and message id errors from the new service events. Then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The starter no longer compiles against Flow 25.4, because
spring-webstopped coming in throughvaadin-spring. This PR addsspring-webto the starter as an optional dependency. It also creates the resync detection filter only whenspring-webis on the classpath, so the rest of the starter still works without it.What changed
SpringResyncDetectionFilterregistration bean is now created only whenOncePerRequestFilter(fromspring-web) is on the classpath. Only apps withoutspring-webare affected: they no longer get the filter, and the app starts normally instead of failing. Apps that use Spring MVC see no change.observability-kit-starter/pom.xml:spring-webis now declared as anoptionaldependency. Before, the starter got it throughvaadin-spring, butvaadin-spring25.4 declaresspring-webmvcasprovided.ObservabilityAutoConfiguration: theresyncDetectionFilterbean moved into a nestedResyncDetectionFilterConfigurationclass guarded by@ConditionalOnClass(OncePerRequestFilter.class). Its other conditions are the same as before: it needs aMeterRegistrybean, backs off if you define your own bean, and turns off withvaadin.observability.resync=false.Test summary
Resync detection filter auto-configuration:
spring-webis presentOncePerRequestFilteris missing from the classpathspring-web