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

Don't show loading on refetch if previous call was an error #46

Open
selankon opened this issue Jul 5, 2024 · 1 comment
Open

Don't show loading on refetch if previous call was an error #46

selankon opened this issue Jul 5, 2024 · 1 comment
Assignees

Comments

@selankon
Copy link
Collaborator

selankon commented Jul 5, 2024

Not sure if I should give attention to this because is an edge case. Sometimes when stg is restarted and the block deoesn't exists anymore, if you try to access to the firsts blocks a 404 error is shown.

This is normal, block is not found because it doesn't exist anymore, is a backend issue.

The problem here is that when block height changes and the block list is refetched, the placeholder is shown again (showing previous loaded list).

I didn't found a way to fix this at first moment, which is so strange that react query didn't think about this case. I don't want to show the placeholder data blinking between refetch if an error is shown until the next call is success.

I looked at ReactQuery docs without success, and a way I though to do this is to create a previous state like previousCallWasAnError or similar, which sounds odd and buggie.

https://tanstack.com/query/latest/docs/framework/react/guides/paginated-queries#better-paginated-queries-with-placeholderdata

I find that if I add a refetch interval into the process list page, and i search by a process that doesn't exist, the behavior is the same.

I let this open FTR and lets see if needs attention

@selankon selankon self-assigned this Jul 10, 2024
@selankon
Copy link
Collaborator Author

This could help to the error because placeholder will content data

vocdoni/ui-components#189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant