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(explore): Re-enable Explore re-render on Save As #20704

Conversation

codyml
Copy link
Member

@codyml codyml commented Jul 14, 2022

SUMMARY

The combination of #20498 and #20645 caused a regression in Explore logic such that when a chart is saved as a new chart, the chart wouldn't render once the modal was closed without clicking the "Update Chart" button. This broke a Cypress test, explore/link.test.ts that's currently failing on master, but which wasn't picked up by CI before merge because CI on #20645 was run before #20498 had been merged and the two PRs didn't have any conflicts that would prompt GH to require a rebase. This PR reverts a little bit of #20645, making the HYDRATE_EXPLORE Redux action once again update the datasources store key in the same step instead of in a different step. I don't really understand why this change fixes the issue, but it seems like the Explore components only refresh as expected if datasources is updated as part of the HYDRATE_EXPLORE action.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen.Recording.2022-07-13.at.7.25.46.PM.mov

After:

Screen.Recording.2022-07-13.at.7.23.58.PM.mov

TESTING INSTRUCTIONS

  • Check that saving a chart as a new chart causes the chart to render.
  • Check that Cypress tests are now passing.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

We can't have Explore actions inside the datasource module because datasources are a shared resource. Let's sync on this.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jul 14, 2022
@codyml codyml force-pushed the codyml/sc-52732/figure-out-why-cypress-test-is-failing branch from f9c8f71 to 95dc1d7 Compare July 14, 2022 13:01
@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #20704 (95dc1d7) into master (6b0bb80) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #20704      +/-   ##
==========================================
- Coverage   66.83%   66.83%   -0.01%     
==========================================
  Files        1750     1750              
  Lines       65894    65895       +1     
  Branches     7017     7018       +1     
==========================================
- Hits        44041    44039       -2     
- Misses      20067    20069       +2     
- Partials     1786     1787       +1     
Flag Coverage Δ
javascript 51.93% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset-frontend/src/datasource/reducer.ts 11.11% <0.00%> (-3.18%) ⬇️
...set-frontend/src/explore/actions/hydrateExplore.ts 60.00% <ø> (-1.54%) ⬇️
superset-frontend/src/datasource/actions.ts 0.00% <0.00%> (-33.34%) ⬇️

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 6b0bb80...95dc1d7. Read the comment docs.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Approving this as a hot-fix. We should remove Explore specific state from the datasources reducer.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

We can't remove initDatasources. Can you restore that line and check if the bug continues to be fixed?

@codyml
Copy link
Member Author

codyml commented Jul 20, 2022

Closing in favor of #20796.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants