-
Notifications
You must be signed in to change notification settings - Fork 3k
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: prevent Onyx to be updated when the user is logged out #19197
fix: prevent Onyx to be updated when the user is logged out #19197
Conversation
src/libs/actions/User.js
Outdated
// If we don't have the currentUserAccountID (user is logged out) we don't want to update Onyx with data from Pusher | ||
if (!currentUserAccountID) { | ||
return; | ||
} |
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.
Should have been applied in line 585 instead?
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.
Yeah, sorry, my bad 🙈 , you're right!
Since I was tagged on the issue I'll review this on Monday |
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.
Awesome, the code looks good and it tests well. We can merge it like this if you want, or add some optional improvements.
I did notice this comment from @marcaaron and I think he brings up a good point that it might be good to make it more clear that whenever we use getCurrentRequest there's a possibility that the user will be signed out when the promise resolves. Maybe we can modify the SequentialQueue's gtCurrentRequest function to always reject when signed out, and that way the .then handler won't run.
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.
FWIW I think the changes here are fine 👍 but all future code that uses the SequentialQueue.getCurrentRequest()
should probably have these checks. I think we are maybe in the process of replacing on of these channels though looking again...
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.
Thank you @neil-marcellini , Looks good and tests well for me as well.
@koko57 Can we apply @marcaaron's suggestion ? it looks more complex and require some additional changes as well.
Reviewer Checklist
Screenshots/VideosWebWebhq.movMobile Web - ChromeChrome.movMobile Web - SafariSafari.movDesktopDesktop.moviOSIOS.movAndroidAndroid.mov |
Congrats, that’s your 5th PR merged! 🎉 Do you know about the ContributorPlus role? It’s an opportunity to earn more in the Expensify Open Source community. Keep up the great work - thanks! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
I am going to CP this to staging as it seems like there are some problems with signing in after sign out and this should hopefully help with it. |
Workflow is here https://github.com/Expensify/App/actions/runs/5071644748 |
…-issue fix: prevent Onyx to be updated when the user is logged out (cherry picked from commit b424edc)
…-19197 🍒 Cherry pick PR #19197 to staging 🍒
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 1.3.17-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.17-5 🚀
|
🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.28-2 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀
|
Details
Fixed Issues
$ #17148
PROPOSAL: #17148(COMMENT)
Tests
Instead disabling the internet connection, you can simulate slow connection (throttling in the Network tab, i.e slow 3g)
Offline tests
QA Steps
Instead disabling the internet connection, you can simulate slow connection (throttling in the Network tab, i.e slow 3g)
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Screen.Recording.2023-05-18.at.10.52.00.mov
Mobile Web - Chrome
Screen.Recording.2023-05-18.at.11.35.46.mov
Mobile Web - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
Screen.Recording.2023-05-18.at.11.26.30.mov