GenericFilter: on re-navigation only the entry configuration is restored; changes in other configurations persist #5488#5505
Open
fractal3000 wants to merge 1 commit into
Conversation
… the entry one (5488)
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 #5488
Depends on #5425 fix
Problem
On a clean same-view re-navigation the filter restored only the configuration that was current at initialization (the entry configuration). Changes made to any other configuration — a condition added or removed, via the URL or by user actions — were not restored and persisted for the session (until a full view reload).
Fix
GenericFilterUrlQueryParametersBindernow snapshots every configuration atsaveInitialState(all registered configurations plus the empty one), andapplyInitialStaterestores each of them, then makes the entry configuration current again. The per-configuration restore reuses the existing structure/default-value/state reconciliation; the restore of non-current configurations happens on their models, so switching to them later shows the restored state.Behaviour change (relative to the re-navigation PR)
This extends #5425. The re-navigation PR intentionally restored only the entry configuration; #5488 broadens that to all configurations. The corresponding test in #5425 (which asserted the entry-only scope) is updated to the new expectation. Both PRs are unreleased, so no released behaviour changes; the shipped behaviour is the combined result.
Tests
Two tests in
GenericFilterReNavigationTest— a condition added to a non-entry configuration is removed on re-navigation, and a condition removed from a non-entry configuration is restored — both while the entry configuration is restored as before. Verified they fail on the entry-only snapshot and pass with the per-configuration snapshot; the rest of the re-navigation suite stays green.Backward compatibility
No public API change:
saveInitialState/applyInitialState/restore*areprotectedon an@Internalbinder; the internal field changed from a singleInitialStateto aList<InitialState>plus anentryConfigurationreference. The behavioural change is the bug fix itself; no application migration is required.