A generic filter created by the programmatic API becomes broken after navigating to the view a second time #5425#5504
Open
fractal3000 wants to merge 2 commits into
Conversation
added 2 commits
July 17, 2026 21:27
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.
Fixes #5425 and #5487
Problem
A
GenericFilterbound via theurlQueryParametersfacet broke on a clean re-navigation to the same view. When Vaadin reuses the view instance,onInitis not called again, andapplyInitialState()wiped the current configuration instead of restoring it:Fix
On re-navigation the binder now restores the captured initial state instead of clearing it:
modifiedflags are restored, component instances are preserved.Supporting changes: the duplicated base-condition capture/compose logic in
GenericFilterandGroupFilterwas extracted into@Internal BaseConditionSupport(behaviour unchanged); the internalInitialState/ComponentNoderecords and the single-filter state helper are marked@Internal; generic-filter test views were renamed to the*TestViewconvention.Tests
Facet-level re-navigation tests driving the real event chain (
RestoreComponentsStateEvent→QueryParametersChangeEvent): programmatic-baseline survival, empty-configuration clearing, URL value/operation/condition reset, design-time value reset (#5487), nested-group restore, pure-user-action scope, and an event-storm regression. Also a regression test for removing a condition nested in a group (#5486).Commits
restore configuration state on same-view re-navigation (5425, 5487)— the fix and its tests.add a regression test for removing a condition nested in a group (5486)— the regression test.Backward compatibility
No
publicAPI contract is removed or changed: theHasInitialStateinterface is untouched,GenericFilter.updateDataLoaderInitialConditionis kept as@Deprecated(forRemoval = true)rather than removed, and the only new public types (BaseConditionSupport,SingleFilterComponentStateSupport) are@Internaland purely additive. The behavioural changes are the bug fixes themselves — re-navigation now restores the configuration instead of clearing it (#5425) and resets a URL-changed design-time value (#5487); both correct broken behaviour, so no application migration is required.However, the following
protectedmembers of the URL query-parameter binders changed shape. They are now marked@Internal, and all usages are confined to theflowuimodule (no references injmix-premiumor sample apps), but a subclass that referenced them would break at source/binary level. Worth a release-note line for anyone who extended these binders:PropertyFilterUrlQueryParametersBinder(sharpest break): theprotected record InitialState(Operation, Object)is removed, and the type of theprotectedfieldinitialStatechanged fromInitialStatetoSingleFilterComponentStateSupport.State. A subclass reading that field or the record no longer compiles.DataGridFilterUrlQueryParametersBinder.InitialState: record signature changed from(String key, String property, PropertyFilter.Operation operation, Object value)to(String key, String property, SingleFilterComponentStateSupport.State state).GenericFilterUrlQueryParametersBinder.InitialState: record signature changed from(Configuration configuration)to(Configuration configuration, List<ComponentNode> structure, Map<…> states, Map<…> defaultValues); a newComponentNoderecord was added.Mitigations already in place: all three records carry
@Internal, the publicHasInitialStatecontract does not expose them, and the newSingleFilterComponentStateSupportbean is resolved from the standardio.jmix.flowuicomponent scan (no manual wiring needed).