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

Tab-away from app/browser then tab-return to browser causes estimate forms to resubmit, triggering a new network request. #2

Open
mattburnett-repo opened this issue Feb 12, 2023 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mattburnett-repo
Copy link
Owner

mattburnett-repo commented Feb 12, 2023

This shouldn't happen. Once a form is submitted, it shouldn't re-submit if the user tabs away from the app/browser and then tabs back into the app/browser.

The code currently passes the form's requestData to useQuery()'s queryKeys array, but this doesn't consistently solve the problem. Sometimes it works, most of the time it doesn't. No idea why.

Not sure why this happens. The assumption is that the queryKeys will cache the query and prevent a re-render / re-fetch of the Estimate component. This does not work consistently.

useMemo() might solve this. Need to figure out if / where / how.

@mattburnett-repo mattburnett-repo added bug Something isn't working help wanted Extra attention is needed labels Feb 12, 2023
@mattburnett-repo mattburnett-repo changed the title Tab-away from app then tab-return in browser causes estimate form to resubmit, triggering a new network request. Tab-away from app then tab-return in browser causes estimate forms to resubmit, triggering a new network request. Feb 12, 2023
@mattburnett-repo mattburnett-repo changed the title Tab-away from app then tab-return in browser causes estimate forms to resubmit, triggering a new network request. Tab-away from app/browser then tab-return to browser causes estimate forms to resubmit, triggering a new network request. Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant