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

FIX Don't cause invariant violations #1015

Conversation

GuySartorelli
Copy link
Member

if (window.ss.apolloClient.queryManager.fetchQueryRejectFns.size > 0 && numAttempts < 3) {
setTimeout(() => {
resetStores(numAttempts + 1);
}, 200);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}, 200);
}, 500);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we increase to half a second. With 200ms I still see Error in browser console.

Copy link
Member Author

@GuySartorelli GuySartorelli Nov 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you see the error every time with this set to 200ms?

It's already trying 200ms three times - as the comment notes, if it takes longer than that (i.e. > 600ms total) then there's a higher chance of causing issues than resolving them by doing this, because by that time the user is likely interacting with the UI again.
Ultimately the console error doesn't seem to result in any actual problems being caused, so if it still shows up in the console sometimes it's not the end of the world.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have this error in console after 3rd attempt when I save or publish page and ElementalArea is refreshing. I tested it a few times with different time value and it fails on 200, 300 and 400ms, but not on 500ms.
If you say, that increasing time could be a cause of another issue, so we can add this code, but it doesn't solve this issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think increasing the timestep is an option for the reasons I've mentioned.
If this is always failing for you with the 200ms timestep then this PR is not a valid improvement and should be closed, and the ticket put back in the backlog.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll close it before we can find a better solution.

@sabina-talipova
Copy link
Contributor

CLOSE. Error is still in browser console.

@sabina-talipova sabina-talipova deleted the pulls/4.9/invariant-violation branch November 9, 2022 02:33
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

Successfully merging this pull request may close these issues.

2 participants