Skip to content

fix(admin-ui): surface custom report delete failures instead of reporting success#8287

Open
srinath2404 wants to merge 2 commits into
ethyca:mainfrom
srinath2404:fix/custom-report-delete-error-handling
Open

fix(admin-ui): surface custom report delete failures instead of reporting success#8287
srinath2404 wants to merge 2 commits into
ethyca:mainfrom
srinath2404:fix/custom-report-delete-error-handling

Conversation

@srinath2404

Copy link
Copy Markdown

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.tsx handleDeleteReport).

If the DELETE fails, 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: handleDeleteReport now awaits deleteCustomReportMutationTrigger, shows message.error (via getErrorMessage) 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

  1. Data Map report → Custom Reports popover; apply a saved report.
  2. Force the delete to fail (e.g. block/500 */api/v1/plus/custom-report/*).
  3. Delete the applied report → an error message is shown; the applied view is preserved; the report remains listed.
  4. Without the block, delete succeeds → success message and the report is removed.

Pre-Merge Checklist

  • Changelog fragment added
  • No migrations
  • No documentation updates required
  • CI pipelines succeeded
  • CLA signed

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>
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Ethyca Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant