Sravani Revuri created HDDS-17691:
-------------------------------------
Summary: [Recon][UI]Handle failed GET rejections in useApiData
Key: HDDS-17691
URL: https://issues.apache.org/jira/browse/HDDS-17691
Project: Apache Ozone
Issue Type: Bug
Reporter: Sravani Revuri
Assignee: Sravani Revuri
The URL useEffect in v2/hooks/useAPIData.hook.ts calls executeRequest() on
initial mount and on URL change, and neither call has a .catch().
executeRequest always rejects on failure, even after it has set error state and
called onError. So every failed GET leaves an unhandled rejection, in tests and
in the browser.
Missing call site: The retry path has the same problem:
retryTimeoutRef.current = setTimeout(() => {
executeRequest(requestData, true); // also uncaught
}, retryDelay * retryCountRef.current);
A 500 with retries left goes through this branch, so each retry attempt also
rejects unhandled. The Jira should say: "add .catch() to the GET calls in the
URL effect and to the retried executeRequest in the retry setTimeout." A no-op
catch is enough, since error state and onError are already handled inside
executeRequest. It also covers the CanceledError rejection when a URL change
aborts the request in flight.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]