Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debounce isFetching in the catalog ui #5188

Merged
merged 3 commits into from
Aug 10, 2022

Conversation

antgamdia
Copy link
Contributor

Description of the change

  • Even if we implement the other mitigations, there are still some edge cases where the state remains inconsistent. For instance, when selecting a repo filter, scrolling down (to trigger pagination), or selecting another repo filter (to unmount the component)... would lead to a request made to the API when the app is in an isFetching=true state.
    • The proposed solution is twofold:
      • Absorb small race conditions with a dummy wait: this will prevent most of the errors to appear, because it will simply retry the request in 1 or 2 seconds. It requires storing a local copy (component's state) of the isFetching global state var.
      • Return an error if a "request_packages" request arrives at the state reducer while in an isFetching=true state. The UI will simply show a "try again" button, and the user can click on it. This check is to ensure no inconsistent data is shown to the user.

Benefits

No more "no data found" because of inconsistent requests coming.

Possible drawbacks

The UI will simply show a "try again" button with an error when the error happens. This check is to ensure no inconsistent data is shown to the user, but still could be seen as a con.

Applicable issues

Additional information

image

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@netlify
Copy link

netlify bot commented Aug 10, 2022

Deploy Preview for kubeapps-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a1d687e
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/62f37ed650186c0009106f83
😎 Deploy Preview https://deploy-preview-5188--kubeapps-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@antgamdia antgamdia merged commit b1e2014 into vmware-tanzu:main Aug 10, 2022
@antgamdia antgamdia deleted the 5165-debounceIsFetching branch August 10, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants