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: Multiple dashboard refresh triggers for the same session #16094

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Fix: Multiple dashboard refresh triggers for the same session.

@junlincc @jinghua-qa

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

screen-recording-2021-08-05-at-22337-pm_rshjFmrR.mp4
screen-recording-2021-08-05-at-21917-pm_umGDz3Fq.mp4

TESTING INSTRUCTIONS

Check the videos for instructions.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

@codecov
Copy link

codecov bot commented Aug 5, 2021

Codecov Report

Merging #16094 (e9af0c1) into master (7332055) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16094      +/-   ##
==========================================
- Coverage   76.88%   76.85%   -0.04%     
==========================================
  Files         995      995              
  Lines       52864    52887      +23     
  Branches     6712     6721       +9     
==========================================
- Hits        40646    40645       -1     
- Misses      11992    12017      +25     
+ Partials      226      225       -1     
Flag Coverage Δ
javascript 71.23% <100.00%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
...frontend/src/dashboard/components/Header/index.jsx 64.16% <100.00%> (+0.41%) ⬆️
...t-frontend/src/dashboard/util/setPeriodicRunner.ts 70.00% <100.00%> (ø)
...ontrols/DndColumnSelectControl/DndColumnSelect.tsx 46.42% <0.00%> (-14.69%) ⬇️
...onalFormattingControl/FormattingPopoverContent.tsx 29.26% <0.00%> (-4.07%) ⬇️
...src/dashboard/components/PropertiesModal/index.jsx 83.09% <0.00%> (-2.52%) ⬇️
.../ReportModal/HeaderReportActionsDropdown/index.tsx 24.32% <0.00%> (-1.39%) ⬇️
...rontend/src/components/Select/DeprecatedSelect.tsx 85.71% <0.00%> (-1.03%) ⬇️
...tend/src/explore/components/ExploreChartHeader.jsx 55.55% <0.00%> (-0.79%) ⬇️
...FormattingControl/ConditionalFormattingControl.tsx 21.66% <0.00%> (-0.75%) ⬇️
superset-frontend/src/dashboard/actions/hydrate.js 1.69% <0.00%> (-0.02%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7332055...e9af0c1. Read the comment docs.

@junlincc
Copy link
Member

junlincc commented Aug 5, 2021

your BEFORE AFTER videos crack me up LOL! ∞∞∞∞∞∞∞ .thanks for the fix! LGTM

@junlincc junlincc added the need:review Requires a code review label Aug 5, 2021
@@ -366,7 +366,8 @@ export const hydrateDashboard = (dashboardData, chartData) => (
directPathLastUpdated: Date.now(),
focusedFilterField: null,
expandedSlices: metadata?.expanded_slices || {},
refreshFrequency: metadata?.refresh_frequency || 0,
refreshFrequency:
metadata?.refresh_frequency || dashboardState.refreshFrequency || 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the || dashboardState.refreshFrequency here. If you start at dashboard A (which has refresh), navigate to the dashboard list and then go to dashboard B (which has no refresh) wouldn't B inherit the refresh frequency from A?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we had a redux store where these things were keyed by dashboard id

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suddjian You are totally right! I tested and B is inheriting from A. I'll try to fix it.

@suddjian
Copy link
Member

suddjian commented Aug 6, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2021

@suddjian Ephemeral environment spinning up at http://34.220.92.135:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@michael-s-molina
Copy link
Member Author

@suddjian @junlincc Since our redux store is not indexed by the dashboard, and changing that can potentially break other functions, I decided to cancel the timers as soon as the user leaves the dashboard. Is not the ideal solution, but it's better than the current state, where the timers are being duplicated.

Copy link
Member

@suddjian suddjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix!

@michael-s-molina michael-s-molina merged commit 07f3399 into apache:master Aug 10, 2021
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

stevenuray pushed a commit to preset-io/superset that referenced this pull request Aug 12, 2021
@rosemarie-chiu
Copy link
Contributor

🏷 2021.31

@villebro villebro added the v1.3 label Aug 16, 2021
villebro pushed a commit that referenced this pull request Aug 16, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels need:review Requires a code review preset:2021.31 size/XS v1.3 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants