Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-26143

Watch resource hook does not clear error state on connection re-establishment

XMLWordPrintable

      When using the useK8sWatchResource() hook, if there is a network failure when polling the resource, the hook does not update the error state after recovering even as subsequent fetches are successful.

      Steps:

      • Use watch hook to watch any resource
      • Block the resource get call in browser devtools
      • Once the call fails, unblock the call
      • Subsequent calls will be successful, but the hook will still continue to return error

      This is likely caused by https://github.com/openshift/dynamic-plugin-sdk/blob/main/packages/lib-utils/src/app/redux/reducers/k8s/k8s.ts#L195
      The reducer action does not consider that the previous poll might have failed so doesn't fire an update to remove the loadError state.

              mdsaud Mohammed Saud (Inactive)
              mdsaud Mohammed Saud (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: