Repository navigation
fix: show the server's error message in the publish toggle and user info toasts - #44238
Conversation
e318b80 to
7b321e5
Compare
…nfo toasts The dashboard Draft/Published toggle and the user info modal discarded the failed response and always showed a fixed toast, so an explicit message returned by the backend (a validation error, or a guard added by an extension) never reached the user. Both now show the error text read with `getClientErrorObject`, and keep the current toast when the response carries no message.
7b321e5 to
aa1f058
Compare
|
The flagged issue is correct. In the current implementation of To resolve this, you should ensure that the Would you like me to implement this fix for you, and would you like me to check and address the rest of the comments on this PR as well? superset-frontend/src/features/userInfo/UserInfoModal.tsx |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44238 +/- ##
=======================================
Coverage 80.17% 80.18%
=======================================
Files 2925 2925
Lines 172679 172685 +6
Branches 40092 40096 +4
=======================================
+ Hits 138452 138462 +10
+ Misses 31630 31626 -4
Partials 2597 2597
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review Agent Run #3c37c4Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #d85240Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
rusackas
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the tests covering both paths. Approving.
SUMMARY
When saving fails, the Draft/Published toggle in the dashboard header and the user info modal always show the same fixed toast ("You do not have permissions to edit this dashboard." / "Something went wrong while saving the user info"). The error message returned by the server is dropped. This matters for extensions that add server-side guards on these endpoints, since their explicit refusal never reaches the user, and for Superset's own errors, such as the validation errors of
PUT /api/v1/me/. Both flows now show the error text fromgetClientErrorObject, as other dashboard actions already do. They keep the current toast when the response has no message, and the toggle also keeps it for the defaultForbidden403 body.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: always the fixed toast. After: the server's message, e.g. "Length must be between 1 and 64."
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION