-
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 all 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; | ||
|
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. 👀 The removed The cost is fragility: any future client path that changes the filter, or any new server reader of ComboBoxBase.java:102 · |
||
|
|
||
| /** | ||
| * 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.
🧹 Test hand-builds a
WebDriverWaitinstead of the inheritedwaitUntilhelper used throughout this module.AbstractComponentIT(viacom.vaadin.flow.testutil.AbstractComponentIT) already provideswaitUntil(ExpectedCondition), and it is the established pattern across this IT module (ComboBoxClearIT,DataProviderIT,ClientSideFilterIT, and others). The new code instead constructsnew WebDriverWait(driver, Duration.of(2, ChronoUnit.SECONDS))and pulls in three extra imports (Duration,ChronoUnit,WebDriverWait).The cost is inconsistent timeout/polling behavior and boilerplate the shared helper exists to avoid. Replace with
waitUntil(ExpectedConditions.textToBePresentInElement(query, "Filter: 1 Count: 10")).LazyComboBoxFilterIT.java:43 ·
reuse·confirmed