fix(admin-ui): surface custom report delete failures instead of reporting success#8287
Open
srinath2404 wants to merge 2 commits into
Open
fix(admin-ui): surface custom report delete failures instead of reporting success#8287srinath2404 wants to merge 2 commits into
srinath2404 wants to merge 2 commits into
Conversation
handleDeleteReport fired the delete mutation without awaiting or checking its result, and cleared the applied report before the request resolved. A failed delete therefore showed no error and looked successful while the report still existed on the server (the list/label refresh only after a successful, tag-invalidating mutation). Await the mutation, surface an error on failure (matching the sibling handleSelection), and only clear the applied report once the delete actually succeeds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Someone is attempting to deploy a commit to the Ethyca Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description Of Changes
In the Data Map report's Custom Reports popover, deleting a report calls the delete mutation without awaiting or checking its result, and clears the currently-applied report before the request resolves (
CustomReportTemplates.tsxhandleDeleteReport).If the
DELETEfails, the UI shows no error, the applied report/view is wiped, and a success-looking outcome is presented — yet the report still exists on the server (the list and trigger label only refresh on a successful, tag-invalidating mutation), so it silently reappears on reload.This PR awaits the mutation, surfaces an error on failure (matching the sibling
handleSelection), and only clears the applied report once the delete actually succeeds.Code Changes
clients/admin-ui/src/features/common/custom-reports/CustomReportTemplates.tsx:handleDeleteReportnow awaitsdeleteCustomReportMutationTrigger, showsmessage.error(viagetErrorMessage) on failure and returns early, clears the applied report only after a successful delete, and shows a success message.clients/admin-ui/cypress/e2e/datamap-report.cy.ts: added a test asserting that a failed delete surfaces an error and keeps the report (the failure path was previously untested).changelog/fix-custom-report-delete-error-handling.yaml: added.Steps to Confirm
*/api/v1/plus/custom-report/*).Pre-Merge Checklist