-
Notifications
You must be signed in to change notification settings - Fork 78
Avoid obsolete filter syncing [2 days] #7135
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
Changes from 2 commits
a055bc0
29d5749
a2cd96f
24a8a24
44fc546
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,8 @@ public abstract class ComboBoxBase<TComponent extends ComboBoxBase<TComponent, T | |
| HasValidationProperties, HasValidator<TValue>, HasPlaceholder { | ||
| private static final int DEFAULT_FILTER_TIMEOUT = 500; | ||
|
|
||
| private String lastKnownFilter; | ||
|
|
||
| /** | ||
| * Registration for custom value listeners that disallows entering custom | ||
| * values as soon as there are no more listeners for the custom value event | ||
|
|
@@ -346,9 +348,8 @@ public void setAllowCustomValue(boolean allowCustomValue) { | |
| * | ||
| * @return the filter string | ||
| */ | ||
| @Synchronize(property = "filter", value = "filter-changed") | ||
| protected String getFilter() { | ||
| return getElement().getProperty("filter"); | ||
| return lastKnownFilter; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -359,7 +360,11 @@ protected String getFilter() { | |
| * @param filter | ||
| * the String value to set | ||
| */ | ||
| @Deprecated | ||
| protected void setFilter(String filter) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 With The cost is that a future maintainer cannot tell what the method is for or whether it is safe to delete: the javadoc, the inline comment, and the ComboBoxBase.java:364 · |
||
| lastKnownFilter = filter; | ||
| // MT 20250-02-21 I assume client side never uses this, probably the | ||
| // whole method is obsolete | ||
| getElement().setProperty("filter", filter == null ? "" : filter); | ||
| } | ||
|
|
||
|
|
@@ -1367,6 +1372,7 @@ private void confirmUpdate(int id) { | |
| */ | ||
| @ClientCallable | ||
| private void setViewportRange(int start, int length, String filter) { | ||
| this.lastKnownFilter = filter; | ||
| dataController.setViewportRange(start, length, filter); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
lastKnownFilteris a hand-maintained shadow of the filter that must be poked at every client entry point, and already misses paths on day one.The removed
@Synchronizewas a single source of truth kept current by Flow on everyfilter-changedevent. The replacement is a field updated in only two sites (setFilter()and thesetViewportRangeRPC) and never cleared — so it already fails to track the client-side-filter path and the popup-close path (see the two correctness findings).ComboBoxDataControlleralso already tracks the requested filter in its ownlastFilterfield.The cost is fragility: any future client path that changes the filter, or any new server reader of
getFilter(), must remember to update this private field, with nothing enforcing it. A deeper fix would adjust when the client sends the filter (dropping the redundant per-keystroke sync) rather than adding a parallel field that drifts out of sync.ComboBoxBase.java:102 ·
altitude·plausible