You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/10/24 11:24:48 UTC
[GitHub] [superset] kgabryje opened a new pull request, #21920: fix(explore): Chart save modal displays error instead of failing silently
kgabryje opened a new pull request, #21920:
URL: https://github.com/apache/superset/pull/21920
### SUMMARY
When user tried to save a chart and a request executed by SaveModal chart failed, the modal would just close and there would be no indication that an error occurred. That might lead the user to think that their chart was successfully saved even though it wasn't.
This PR fixes that behaviour by not closing the modal and displaying an alert with error message within it.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
https://user-images.githubusercontent.com/15073128/197514948-a996021b-bd5d-4939-aee5-c9f23c34b2d6.mov
After:
https://user-images.githubusercontent.com/15073128/197514625-2667b4fe-519b-4313-be65-58e00a31c66f.mov
### TESTING INSTRUCTIONS
1. Open the chart save modal
2. Turn off the Internet (to trigger an error)
3. Click save button
4. See that the error is displayed and the modal doesn't close
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] 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
CC @codyml
--
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] kgabryje commented on pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1291711015
@geido @codyml Thank you for your feedback and testing! I fixed the issue with chart disappearing after saving.
The problem was a race condition between re-hydrating explore after saving and triggering query. Because of some strange flows in the code, delaying closing the save modal was causing the query to be triggered before Explore was rehydrated. The result was that the query was updating the previous chart (previous slice_id), instead of the freshly created one.
I fixed this issue by moving the logic responsible for detecting saving from URL (we were reading `saveaction` search parameter in the URL to decide if query needs to be triggered) to Redux (which is now being set by `hydrateExplore`, so now the correct order of actions is ensured).
https://user-images.githubusercontent.com/15073128/197980861-9190ccc0-9dfe-4a71-9778-ba481d75fc9c.mov
--
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] github-actions[bot] commented on pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1288999846
@kgabryje Ephemeral environment spinning up at http://34.220.201.232:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
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] kgabryje commented on pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1293627929
> * I think the loading indicator is still left-justified
Oops, I didn't notice your first comment. Fixed ๐
> * I noticed that the overwrite/saveas toggle is now sticky on the same chart, so if you open a chart that you don't have permission to overwrite and save it as a new chart, the next time you go to save it'll still be on Save As, whereas previously I think it would always default to Overwrite if you had permissions. Do we want to maintain that previous behavior?
Well spotted! ๐ Fixed
--
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] geido commented on pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
geido commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1290439702
Hey @kgabryje I think I am noticing a weird behaviour when saving the chart as a new one. After saving the chart shows the empty state.
https://user-images.githubusercontent.com/60598000/197768634-56288be1-d1d8-40c4-80c7-6eb7d5f57c27.mp4
--
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] kgabryje commented on pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1288995831
/testenv up
--
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] codyml commented on a diff in pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
codyml commented on code in PR #21920:
URL: https://github.com/apache/superset/pull/21920#discussion_r1003780253
##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -150,9 +151,6 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
async saveOrOverwrite(gotodash: boolean) {
this.setState({ alert: null, isLoading: true });
this.props.actions.removeSaveModalAlert();
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
-
- let promise = Promise.resolve();
Review Comment:
Changing promises to `await`s looks great, thanks! Two related notes:
1. Since all the `catch` blocks are the same, should we just wrap the entire function body in one `try` block?
2. Previously, since these promises had no `catch` block, errors would go unhandled and therefore show up in the browser console. Should we preserve that behavior by re-throwing or not catching errors?
If you think yes for both of those, we could just do something like:
```javascript
async saveOrOverwrite(goodish:boolean) {
try {
// If anything throws here, modal will stay open, finally block will execute,
// and error will remain unhandled because there's no catch block
this.props.onHide();
} finally {
this.setState({ isLoading: false });
}
}
--
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] kgabryje commented on a diff in pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #21920:
URL: https://github.com/apache/superset/pull/21920#discussion_r1005411360
##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -150,9 +151,6 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
async saveOrOverwrite(gotodash: boolean) {
this.setState({ alert: null, isLoading: true });
this.props.actions.removeSaveModalAlert();
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
-
- let promise = Promise.resolve();
Review Comment:
Great idea! Done
--
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 #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1292302324
# [Codecov](https://codecov.io/gh/apache/superset/pull/21920?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 [#21920](https://codecov.io/gh/apache/superset/pull/21920?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9bbf0df) into [master](https://codecov.io/gh/apache/superset/commit/7600da80412186d0f5d0c85e6cd831fbae2e9d9e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7600da8) will **increase** coverage by `0.00%`.
> The diff coverage is `31.25%`.
```diff
@@ Coverage Diff @@
## master #21920 +/- ##
=======================================
Coverage 66.95% 66.96%
=======================================
Files 1807 1807
Lines 69196 69200 +4
Branches 7402 7404 +2
=======================================
+ Hits 46331 46339 +8
- Misses 20954 20955 +1
+ Partials 1911 1906 -5
```
| Flag | Coverage ฮ | |
|---|---|---|
| javascript | `53.40% <31.25%> (+0.01%)` | :arrow_up: |
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/21920?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/explore/ExplorePage.tsx](https://codecov.io/gh/apache/superset/pull/21920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvRXhwbG9yZVBhZ2UudHN4) | `0.00% <0.00%> (รธ)` | |
| [...et-frontend/src/explore/reducers/exploreReducer.js](https://codecov.io/gh/apache/superset/pull/21920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZXhwbG9yZVJlZHVjZXIuanM=) | `38.09% <0.00%> (-0.62%)` | :arrow_down: |
| [...rset-frontend/src/explore/components/SaveModal.tsx](https://codecov.io/gh/apache/superset/pull/21920/diff?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) | `40.00% <13.33%> (+1.46%)` | :arrow_up: |
| [.../explore/components/ExploreViewContainer/index.jsx](https://codecov.io/gh/apache/superset/pull/21920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci9pbmRleC5qc3g=) | `52.77% <33.33%> (-0.23%)` | :arrow_down: |
| [...set-frontend/src/explore/actions/exploreActions.ts](https://codecov.io/gh/apache/superset/pull/21920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvYWN0aW9ucy9leHBsb3JlQWN0aW9ucy50cw==) | `57.50% <50.00%> (-0.40%)` | :arrow_down: |
| [...rc/explore/components/ExploreChartHeader/index.jsx](https://codecov.io/gh/apache/superset/pull/21920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlQ2hhcnRIZWFkZXIvaW5kZXguanN4) | `57.14% <80.00%> (+1.37%)` | :arrow_up: |
| [...set-frontend/src/explore/actions/hydrateExplore.ts](https://codecov.io/gh/apache/superset/pull/21920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvYWN0aW9ucy9oeWRyYXRlRXhwbG9yZS50cw==) | `57.14% <100.00%> (+1.04%)` | :arrow_up: |
| [...t-frontend/src/explore/actions/saveModalActions.js](https://codecov.io/gh/apache/superset/pull/21920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvYWN0aW9ucy9zYXZlTW9kYWxBY3Rpb25zLmpz) | `97.33% <100.00%> (+0.07%)` | :arrow_up: |
| [...-frontend/src/explore/reducers/saveModalReducer.js](https://codecov.io/gh/apache/superset/pull/21920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvc2F2ZU1vZGFsUmVkdWNlci5qcw==) | `54.54% <100.00%> (+24.54%)` | :arrow_up: |
| ... and [2 more](https://codecov.io/gh/apache/superset/pull/21920/diff?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] kgabryje commented on pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1293937126
/testenv up
--
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] github-actions[bot] commented on pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1294171482
@kgabryje Ephemeral environment spinning up at http://54.190.235.8:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
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] kgabryje merged pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
kgabryje merged PR #21920:
URL: https://github.com/apache/superset/pull/21920
--
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] github-actions[bot] commented on pull request #21920: fix(explore): Chart save modal displays error instead of failing silently
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #21920:
URL: https://github.com/apache/superset/pull/21920#issuecomment-1294193383
Ephemeral environment shutdown and build artifacts deleted.
--
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