-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: infinite api requests when the verification token is invalid #2736
Conversation
Yikes!
This is definitely an improvement and should solve the problem. It feels like a bit of a band-aid solution though. You've identified that the core problem is having
|
@lindapaiste Great suggestion, I have made the following changes you listed in #2405 (comment). It works well since the dependency array contains the verification token which is memoized there are no infinite loops. |
@lindapaiste, could you please review the changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Just one minor change.
I went ahead and committed my suggestion because I want to get this bug fixed. As a side note, it's weird that the message that we show when the token is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's so much cleaner now, thank you!
Fixes #2652
Changes:
Because of the continuous prop changes the useEffect was executing infinitely, I have added a state that allows only one API call to check where the token in invalid or not.
I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123
Untitled.video.-.Made.with.Clipchamp.6.mp4