qf-jonathan commented on code in PR #37488:
URL: https://github.com/apache/superset/pull/37488#discussion_r2844288862


##########
superset-frontend/src/views/store.ts:
##########
@@ -37,7 +37,7 @@ import sliceEntities from 
'src/dashboard/reducers/sliceEntities';
 import dashboardLayout from 'src/dashboard/reducers/undoableDashboardLayout';
 import logger from 'src/middleware/loggerMiddleware';
 import saveModal from 'src/explore/reducers/saveModalReducer';
-import explore from 'src/explore/reducers/exploreReducer';
+import explore from 'src/explore/reducers/undoableExploreReducer';

Review Comment:
   The concern about a “redux-undo filter bug” is based on a misunderstanding 
of issue [#306](https://github.com/omnidan/redux-undo/issues/306).
   
   That issue was not a library bug, it was caused by filtering the wrong 
action types when using Redux Toolkit. The incorrect example filtered
   
   ```javascript
   excludeAction(["increment2", "decrement2"])
   ```
   
   But RTK generates action types as `sliceName/actionName`
   
   So the real dispatched type was `count/increment2`, which obviously won't 
match `increment2`.
   
   You can see this demonstrated here:
   
   Incorrect example (mismatched types):
   
https://codesandbox.io/s/rtk-redux-undo-example-forked-v4d3jn?file=/src/app/store.ts
   
   Correct example (properly matching action types):
   
https://codesandbox.io/p/sandbox/rtk-redux-undo-example-forked-v4d3jn?file=/src/app/store.ts
   
   In the corrected version, filtering works exactly as expected.
   
   In our implementation, we are filtering using the actual action types (not 
unprefixed strings), so the scenario described in 
[#306](https://github.com/omnidan/redux-undo/issues/306) cannot occur here.
   
   Because of that, switching to a wrapper approach like 
`undoableDashboardLayout` is not necessary to “avoid a filter bug”, there is no 
filter bug in this case.



-- 
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