You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2023/03/02 19:01:36 UTC

[GitHub] [superset] justinpark opened a new pull request, #23265: fix(sqllab): dedupe active_tab in tabHistory

justinpark opened a new pull request, #23265:
URL: https://github.com/apache/superset/pull/23265

   ### SUMMARY
   When `SQLLAB_BACKEND_PERSISTENCE` has been deactivated after activated, active_tab will be provided during localstorage persistence mode.
   This causes the appending duplicated tabId value every time page is loaded.
   This commit adds the dedupe logic to clean up the duplicated values.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   - After
   
   <img width="162" alt="Screenshot 2023-03-02 at 10 24 21 AM" src="https://user-images.githubusercontent.com/1392866/222525846-3fe135d4-e0a3-483a-b8f0-f8c7562d47bf.png">
   
   - Before
   
   <img width="860" alt="Screenshot 2023-03-02 at 10 23 38 AM" src="https://user-images.githubusercontent.com/1392866/222525838-c29b647d-8536-418d-a0c8-e9abe9b04f0d.png">
   
   ### TESTING INSTRUCTIONS
   set SQLLAB_BACKEND_PERSISTENCE on and open SqlLab
   disable SQLLAB_BACKEND_PERSISTENCE and open SqlLab
   keep refresh the page and then check the redux value in the local storage
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] 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
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #23265: fix(sqllab): dedupe active_tab in tabHistory

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #23265:
URL: https://github.com/apache/superset/pull/23265#issuecomment-1452459704

   # [Codecov](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#23265](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e27b937) into [master](https://codecov.io/gh/apache/superset/commit/d16eda6e5623e6c18b6e1fc20aebc1daf1d789c8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d16eda6) will **increase** coverage by `1.76%`.
   > The diff coverage is `38.09%`.
   
   > :exclamation: Current head e27b937 differs from pull request most recent head ffa3e13. Consider uploading reports for the commit ffa3e13 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #23265      +/-   ##
   ==========================================
   + Coverage   65.74%   67.51%   +1.76%     
   ==========================================
     Files        1907     1907              
     Lines       73431    73438       +7     
     Branches     7973     7977       +4     
   ==========================================
   + Hits        48280    49583    +1303     
   + Misses      23103    21803    -1300     
   - Partials     2048     2052       +4     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `53.77% <46.15%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/dashboard/actions/hydrate.js](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL2h5ZHJhdGUuanM=) | `2.08% <ø> (+0.02%)` | :arrow_up: |
   | [...src/dashboard/components/DashboardBuilder/state.ts](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Rhc2hib2FyZEJ1aWxkZXIvc3RhdGUudHM=) | `70.37% <ø> (-2.05%)` | :arrow_down: |
   | [...tiveFilters/FilterBar/CrossFilters/CrossFilter.tsx](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0Nyb3NzRmlsdGVycy9Dcm9zc0ZpbHRlci50c3g=) | `56.25% <0.00%> (ø)` | |
   | [...rontend/src/dashboard/containers/DashboardPage.tsx](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZFBhZ2UudHN4) | `8.79% <0.00%> (-0.10%)` | :arrow_down: |
   | [...uperset-frontend/src/pages/ChartCreation/index.tsx](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3BhZ2VzL0NoYXJ0Q3JlYXRpb24vaW5kZXgudHN4) | `58.62% <0.00%> (-3.20%)` | :arrow_down: |
   | [superset/dashboards/schemas.py](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGFzaGJvYXJkcy9zY2hlbWFzLnB5) | `99.48% <ø> (-0.01%)` | :arrow_down: |
   | [superset/utils/webdriver.py](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvd2ViZHJpdmVyLnB5) | `81.03% <25.00%> (ø)` | |
   | [...et-frontend/src/dashboard/actions/sliceEntities.js](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL3NsaWNlRW50aXRpZXMuanM=) | `77.14% <50.00%> (-1.65%)` | :arrow_down: |
   | [...rset-frontend/src/explore/components/SaveModal.tsx](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9TYXZlTW9kYWwudHN4) | `37.96% <66.66%> (-0.72%)` | :arrow_down: |
   | [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `50.00% <100.00%> (+3.33%)` | :arrow_up: |
   | ... and [91 more](https://codecov.io/gh/apache/superset/pull/23265?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a diff in pull request #23265: fix(sqllab): dedupe active_tab in tabHistory

Posted by "ktmud (via GitHub)" <gi...@apache.org>.
ktmud commented on code in PR #23265:
URL: https://github.com/apache/superset/pull/23265#discussion_r1123651287


##########
superset-frontend/src/SqlLab/reducers/getInitialState.js:
##########
@@ -19,6 +19,14 @@
 import { t } from '@superset-ui/core';
 import getToastsFromPyFlashMessages from 'src/components/MessageToasts/getToastsFromPyFlashMessages';
 
+export function dedupeTabHistory(tabHistory) {

Review Comment:
   I think you can maybe just skip appending if the last id is the same as current id? Removing duplicates are not necessary when things are working as expected. If a users's localStorage already has bad states because of this, we can just ask them to clear the local storage or close the tabs manually themelves.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas merged pull request #23265: fix(sqllab): dedupe active_tab in tabHistory

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #23265:
URL: https://github.com/apache/superset/pull/23265


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org