Loyal-Young opened a new issue, #5176:
URL: https://github.com/apache/rocketmq-dashboard/issues/5176

   ### Bug
   
   Metrics Explorer reads the saved metric profile directly from `localStorage` 
after the profile API succeeds. When the browser rejects that read (for 
example, a `SecurityError` in a restricted storage context), the promise's 
generic error handler displays “Failed to load metric profiles” and never loads 
the available panels. The profile API itself has succeeded.
   
   The profile selector and history restore also write to `localStorage` before 
updating state. A rejected write interrupts those actions.
   
   ### Reproduction
   
   In the frontend test environment, make `Storage.prototype.getItem` and 
`setItem` throw `SecurityError` for `rocketmq-studio.metric-profile`, then 
render Metrics Explorer with a successful profile API response. The explorer 
shows the profile load error instead of its metric panel. A new focused test 
reproduces this failure on current `master`.
   
   ### Expected behavior
   
   The explorer should use the first available profile when saved preferences 
cannot be read. Switching and restoring profiles should continue for the 
current session even if preferences cannot be saved.
   
   ### Proposed fix
   
   Use the existing safe browser-storage helpers for all three 
profile-preference accesses, and cover loading and switching with the 
storage-rejection test.
   


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