unbridled-41 opened a new issue, #5927:
URL: https://github.com/apache/rocketmq-dashboard/issues/5927

   ### Studio Version
   branch: `rocketmq-studio` @ `7e7aa344` (the revision verified; the branch is 
based on it)
   deployed as: not required to reproduce
   
   ### Runtime Environment
   
   Reproduced with the frontend tests (`cd web && npx vitest run 
src/api/client.test.ts`); the effect is the interceptor's own behaviour, 
independent of the browser.
   
   ### Connected RocketMQ Cluster
   
   Not required. The failing requests in production are the export endpoints 
(DLQ Excel export, alert-rule asset export, metrics/Grafana exports).
   
   ### Describe the Bug
   
   The response interceptor extracts the server's error envelope from 
`error.response.data`, but a `responseType: 'blob'` request hands that body 
back as a Blob, so the envelope is invisible to it:
   
   ```
   BLOB response.data type : Blob
   BLOB data.code          : undefined
   BLOB error.message      : "Request failed with status code 501"
   JSON twin error.message : "DLQ operations are not supported for cloud 
instances"
   ```
   
   No toast is shown and the caller's message shows axios's transport text 
instead of the server's sentence, for every export endpoint:
   
   - `501 DLQ operations are not supported for cloud instances`
   - `400 At most 100 msgIds are allowed per export`
   - `400 Audit log export exceeds the maximum of 10000 records; narrow the 
filters`
   
   ### Steps to Reproduce
   
   1. On a cloud instance, press the DLQ Excel export.
   2. The server answers `501 {"code":501,"message":"DLQ operations are not 
supported for cloud instances"}`.
   3. The UI shows `Request failed with status code 501`.
   
   ### What Did You Expect to See?
   
   The server's message, exactly as the same refusal does on a JSON endpoint 
(pinned by `client.test.ts` for the JSON case).
   
   ### What Did You See Instead?
   
   The axios transport text, with no toast.
   
   ### Evidence
   
   - `web/src/api/client.ts` (`getBusinessError`, the rejection handler), call 
sites with `responseType: 'blob'` in `web/src/api/message.ts`, 
`alertRuleAssets.ts`, `metrics.ts`.
   - `cd web && npx vitest run src/api/client.test.ts` - the new case fails 
before the fix with `Request failed with status code 501`.
   
   ### Impact
   
   Every export failure on every such endpoint loses its reason, which is the 
only actionable part of the response.
   
   ### Acceptance Criteria
   
   - A blob error body carrying the business envelope produces the server 
message (toast + rejected error), a blob without one keeps the transport error, 
with regression tests for both.
   
   **Corresponding PR:** #ISSUEPR#
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to