-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Security page][Copilot] Recalculate menu items when personal details change. This fixes profile picture not shown after switching accounts. #49833
Conversation
…shown after switching account
@jasperhuangg Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
cc @dangrous |
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.
LGTM
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, this works for me! Nice find.
@rushatgabhane let us know when you can grab the remaining screen recordings and we can get this merged |
@dangrous added android and desktop |
Reviewer Checklist
Screenshots/Videos2024-10-01_13-04-25.mp4Android: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
I'm going to go ahead and merge, there are still some default avatars it doesn't properly show BUT that's a backend problem - being fixed here. I tested it with that draft PR and it works great. QA, if the tests as listed don't work, ping here - it may be due to the backend issue not this. Hopefully it should be fine either way though. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/dangrous in version: 9.0.43-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/dangrous in version: 9.0.43-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.43-6 🚀
|
The problem is that getPersonalDetailsByEmail(email) is initially undefined, and it won’t recompute because it is not in the dependency array.
To solve this, we have a hook
usePersonalDetails
but it is keyed byaccountID
and we have email only for copilots.So we can add the value returned by the hook
usePersonalDetails
to dependency array ofcreateMenuItems
to recalculate the menu items.Details
Fixed Issues
$ https://expensify.slack.com/archives/C06ML6X0W9L/p1727132093844869?thread_ts=1726494617.816779&cid=C06ML6X0W9L
PROPOSAL: https://expensify.slack.com/archives/C06ML6X0W9L/p1727408773435659?thread_ts=1726494617.816779&cid=C06ML6X0W9L
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Screen.Recording.2024-10-01.at.08.46.32.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2024-09-27.at.14.42.17.mov
iOS: mWeb Safari
Screen.Recording.2024-09-27.at.13.04.51.mov
MacOS: Chrome / Safari
Screen.Recording.2024-09-27.at.12.47.37.mov
MacOS: Desktop
Screen.Recording.2024-10-01.at.08.50.49.mov