Skip to content
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

fix: Filter value resets when switching column types [WEB-1949] #8731

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

mapmeld
Copy link
Contributor

@mapmeld mapmeld commented Jan 23, 2024

Description

In the experiment filter UI, switching from a text filter (Name contains "profile") to a numeric filter (metric = _), calls updateFieldValue(field.id, null);.

Update: the issue is isValid filters fields for the API calls and for saving in updateSettings, so temporary invalid states such as value == null won't be stored, and can get overwritten by previous values. The best option is to separate asJsonString and asSettingsString in the new approach.

2nd Update: now treating this as a race condition, where anything which updates the form field operators and values, is wrapped in an Observable.batch

Test Plan

Set a text query (Name contains "val"); experiments are filtered
Change column name to another text column (Searcher Metric); text value is still used for filter
Change column name to a numeric metric (Searcher Metric Value); value becomes blank
Add new filters; there is no error
Searcher Metric Value filter's value can be set to a number

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Copy link

netlify bot commented Jan 23, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit a67eea7
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/65b7ca346d5aea000802693f
😎 Deploy Preview https://deploy-preview-8731--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 38 lines in your changes are missing coverage. Please review.

Comparison is base (719169a) 47.42% compared to head (a67eea7) 42.33%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8731      +/-   ##
==========================================
- Coverage   47.42%   42.33%   -5.10%     
==========================================
  Files        1047      730     -317     
  Lines      166968   128361   -38607     
  Branches     2242     2242              
==========================================
- Hits        79192    54337   -24855     
+ Misses      87617    73865   -13752     
  Partials      159      159              
Flag Coverage Δ
harness ?
web 42.50% <2.56%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...bui/react/src/pages/F_ExpList/F_ExperimentList.tsx 10.39% <0.00%> (-0.03%) ⬇️
...c/components/FilterForm/components/FilterField.tsx 16.89% <3.57%> (-0.35%) ⬇️

... and 317 files with indirect coverage changes

@ashtonG
Copy link
Contributor

ashtonG commented Jan 23, 2024

could you investigate why a subsequent call to the form store would be overwritten? if observables can't handle two update calls next to each other, that indicates a larger issue.

@mapmeld
Copy link
Contributor Author

mapmeld commented Jan 23, 2024

I've found this doesn't resolve the issue. The formStore's value appears to be reset after fieldValue was set to null.

@mapmeld mapmeld changed the title fix: Filter value resets when switching column types fix: Filter value resets when switching column types [WEB-1949] Jan 24, 2024
@mapmeld mapmeld assigned mapmeld and unassigned keita-determined Jan 25, 2024
@mapmeld mapmeld merged commit 78929c0 into main Jan 29, 2024
74 of 85 checks passed
@mapmeld mapmeld deleted the filtercol branch January 29, 2024 16:26
maxrussell pushed a commit that referenced this pull request Mar 21, 2024
* fix: use Observable.batch to avoid race condition updating exp filter form

* lintfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants