[
https://issues.apache.org/jira/browse/HDDS-17691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sravani Revuri updated HDDS-17691:
----------------------------------
Description:
UseApiData triggers executeRequest() from the URL useEffect (initial mount and
URL changes) and from the retry setTimeout without handling the returned
promise. On failure, executeRequest already updates state and calls onError,
but still rejects the promise, which causes unhandled rejections in Vitest and
in the browser console . Fix by attaching a no-op .catch() to those
fire-and-forget calls; leave execute / refetch unchanged for callers that await
and handle errors.
Found here:https://github.com/apache/ozone/pull/11825#discussion_r4421864671
was:UseApiData triggers executeRequest() from the URL useEffect (initial
mount and URL changes) and from the retry setTimeout without handling the
returned promise. On failure, executeRequest already updates state and calls
onError, but still rejects the promise, which causes unhandled rejections in
Vitest and in the browser console . Fix by attaching a no-op .catch() to those
fire-and-forget calls; leave execute / refetch unchanged for callers that await
and handle errors.
> [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
> Priority: Major
>
> UseApiData triggers executeRequest() from the URL useEffect (initial mount
> and URL changes) and from the retry setTimeout without handling the returned
> promise. On failure, executeRequest already updates state and calls onError,
> but still rejects the promise, which causes unhandled rejections in Vitest
> and in the browser console . Fix by attaching a no-op .catch() to those
> fire-and-forget calls; leave execute / refetch unchanged for callers that
> await and handle errors.
> Found here:https://github.com/apache/ozone/pull/11825#discussion_r4421864671
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]