kgabryje opened a new pull request #17007: URL: https://github.com/apache/superset/pull/17007
### SUMMARY Fixes #16972 Active tabs were calculated in mount/update lifecycle events in Tabs components by taking current active tabs state and appending active tab key to it. That approach resulted in race condition when there are multiple Tabs components added to a dashboard - they were all operating on the same array and when 1 component finished its job, the rest were still operating on the now outdated array of active tabs. The result was overwriting the results calculated by other Tabs components. In order to avoid that, I moved that logic into the Redux reducer, which is guaranteed to be synchronous. Now the Tabs only send current active key and previous active key as strings to Redux and the reducer handles calculating active tabs synchronously. The described issue was the direct reason of the linked bug - the filters were out of scope, because `activeTabs` was not calculated correctly. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Before: see linked issue After: https://user-images.githubusercontent.com/15073128/136361545-77fa09ff-dffe-4832-b405-53af47d98727.mov ### TESTING INSTRUCTIONS 1. Create a dashboard with multiple separate Tabs components, including nested Tabs 2. Verify that `dashboardState.activeTabs` in Redux has correct value 3. Add some native filters with scopes set to different Tabs 4. Verify that in scope/out of scope feature works as expected ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [x] Has associated issue: fixes #16972 - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API CC @junlincc @graceguo-supercat -- 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]
