-
Notifications
You must be signed in to change notification settings - Fork 1
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: Warning banner & post-login redirect both fail when starting Take Now
while already logged into Web App as wrong respondent (M2-8029)
#539
Open
LashaunnaS
wants to merge
4
commits into
dev
Choose a base branch
from
fix/M2-8029-web-take-now-bug-when-credentials-dont-match
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7b6c170
Fix to the useSessionBanners hook to ensure that logic such as banne…
LashaunnaS f2d04c8
Store the original url so that when the app logs out the previously a…
LashaunnaS 8aa8fe0
Capture possibility of of user coming from the loginroute once authen…
LashaunnaS 63045fd
Remove use of useEffect hook. Which seems to be causing removeAllbann…
LashaunnaS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I can't say I actually understand what this change is doing, even after reading your PR description. I get that with a
useMemo
, the callback is executed inline immediately the first time it's encountered by the interpreter, whereas withuseEffect
, the callback is called async after the component has completed the initial render. Could you walk me through exactly what was going wrong here whenuseEffect
was in place?I've also never used
useMemo
for a situation where the return value was discarded, but maybe I just haven't stumbled upon this use-case before now.The React docs on
useMemo
say:I guess I'm also wondering if this code aligns with that rule or not…
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.
@farmerpaul that's a good callout. With further debugging, I think there may be a re-rendering issue stemming from the redux logic w/
user
,token
, andisAuthorized
state. I can't quite pin down what's triggering the re-renders. 🤔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.
@farmerpaul Removing the
useEffect
does ensure the banner isn't automatically cleared because of that particular component re-rendering. I do still have some concerns about the amount of re-rendering taking place, which seems to be a performance issue already established on prod.I think the rerendering we're seeing is coming from how far along the app renders down the tree as the already authenticated user before it determines that the new user isn't authenticated.