#17069·medusa

[Bug]: Promotion edit form silently swallows server errors (no toast, no message)

Author: shanikonimboCreated Sep 29, 2026Updated Sep 29, 2026
Labelsgood first issuetype: bug

Package.json file

json
"@medusajs/admin-sdk": "2.19.0",
"@medusajs/dashboard": "2.19.0",
"@medusajs/framework": "2.19.0",
"@medusajs/medusa": "2.19.0"

Node.js version

v24.15.0

Database and its version

PostgreSQL

Operating system name and version

macOS (reproduced also on a Linux deployment)

Browser name

Chrome

What happended?

Editing a promotion's details in the admin (/app/promotions/:id/edit) sends POST /admin/promotions/:id. When that request fails with a 4xx, nothing is shown: no toast, no inline error. The drawer stays open as if the click did nothing. The error only appears as an unhandled promise rejection in the browser console.

Cause: packages/admin/dashboard/src/routes/promotions/promotion-edit-details/components/edit-promotion-form/edit-promotion-details-form.tsx passes only onSuccess to mutateAsync (line 95 on develop). There is no onError, no try/catch, and toast is not imported.

Other forms handle this, for example product edit (routes/products/product-edit/components/edit-product-form/edit-product-form.tsx:77) and promotion create (create-promotion-form.tsx:173) both do onError: (e) => toast.error(e.message). Promotion edit-details is the outlier.

We hit it because a promotionsUpdated workflow hook rejects some updates with MedusaError.Types.INVALID_DATA. The rejection was correct server-side but invisible to the admin user.

Expected behavior

A failed save shows the server's error message (toast), like the product edit and promotion create forms do.

Actual behavior

No feedback at all. The drawer stays open, and the only trace is an uncaught rejection in the console.

Link to reproduction repo

No repo needed. Stock dashboard, 2.19.0 and develop:

  1. Create two promotions, codes A and B.
  2. Edit B and change its code to A.
  3. Save → the request returns 400 → nothing is shown.

Suggested fix: add onError: (e) => { toast.error(e.message) } to the mutateAsync call (and import toast from @medusajs/ui). A MutationCache onError fallback in the query client would also stop other forms from swallowing errors the same way.