ARBS-23 opened a new issue, #42465:
URL: https://github.com/apache/superset/issues/42465

   ### Bug description
   
   In dashboard **view mode**, after adding a native filter via **Add or edit 
filters** and then deleting it, the deleted filter remains visible in the 
filter bar until the user navigates away from the dashboard.
   
   If the deleted filter had **Select first filter value by default** enabled, 
the dashboard may also fail to render with an error like:
   
   > Unable to load dashboard
   >
   > The following filters have the 'Select first filter value by default' 
option checked and could not be loaded, which is preventing the dashboard from 
rendering: test
   
   This appears to be caused by deleted filter configuration / filter state not 
being cleared from the client state after save.
   
   This may already be addressed by 
https://github.com/apache/superset/pull/37012 (`fix(delete-filter): deleted 
native filters are still shown until [sc-96553]`), which rebuilds native filter 
state from the backend response instead of merging, so deleted filters are 
removed immediately.
   
   ### How to reproduce the bug
   
   1. Log in as any user
   2. Open a dashboard in view mode
   3. Expand the left filter bar (chevron)
   4. Open the settings menu and choose **Add or edit filters**
   5. Add a native filter (optionally enable **Select first filter value by 
default**)
   6. Save the filter, then open **Add or edit filters** again and delete that 
filter
   7. Save and return to the dashboard view
   
   ### Expected behavior
   
   - The deleted filter should disappear from the filter bar immediately after 
save
   - Filter state for the deleted filter should be cleared
   - The dashboard should continue to render without the "Unable to load 
dashboard" error related to the deleted filter
   
   ### Actual behavior
   
   - The deleted filter remains displayed until the user navigates to another 
screen
   - With **Select first filter value by default** enabled on the deleted 
filter, the dashboard may show:
   
   ### Screenshots/recordings
   
   
https://github.com/user-attachments/assets/49abd3c1-53fe-4715-b72f-b5ae88642e31
   
   ### Superset version
   
   6.1.0
   
   ### Python version
   
   3.11
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   - Observed while deleting native filters from a dashboard in view mode (not 
edit mode)
   - Suspected related fix already merged upstream: 
https://github.com/apache/superset/pull/37012
   - That PR changed `handleFilterChangesComplete` / 
`SET_NATIVE_FILTERS_CONFIG_COMPLETE` so filter state is rebuilt from the 
backend response instead of merged with existing state, which previously left 
deleted filters in the UI
   - Please confirm whether this issue is fully covered by #37012 and whether a 
backport is needed for older release lines
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to