Prevent redundant API call when re-selecting the same role on member details page#74215
Prevent redundant API call when re-selecting the same role on member details page#74215cead22 merged 5 commits intoExpensify:mainfrom
Conversation
|
@abzokhattab 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] |
|
@abzokhattab i am having some setup issue for mobile recordings, i will update them tomorrow after fixing it, in the meantime i recorded web videos, in the mean time i think you can also work on reviewers checklist if the code looks fine to you |
|
LGTM |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
PR doesn’t need product input as a code clean-up PR. Unassigning and unsubscribing myself. |
| }); | ||
|
|
||
| const accountIDsToUpdate = loginsToUpdate.map((login) => policyMemberEmailsToAccountIDs[login]).filter((id) => id !== undefined); | ||
| const loginsToUpdate: string[] = []; |
There was a problem hiding this comment.
Isn't this doing the same thing as the old code?
There was a problem hiding this comment.
@twilight2294 i have a pending question here, can you please check
There was a problem hiding this comment.
The old code used to loop over 2 times for the logsin to update the same values, i updated it to create a single for loop and we update both of these values in one for loop rather than iterating the array 2 times
There was a problem hiding this comment.
Left a comment in the code too to make it clear:
There was a problem hiding this comment.
The old code looks cleaner to me. If the 2 loops are the only concern, then we should revert it. Especially that its not change the logic.
What do u think
There was a problem hiding this comment.
any updates on this? .. i still see it is still pending
There was a problem hiding this comment.
sorry, it was weekend , started the day just now, i will update this today
There was a problem hiding this comment.
Yes sorry, I thought u overlooked it as I saw this comment #74215 (comment)
There was a problem hiding this comment.
It's fine, i should had kept you updated 😄
|
Can you please complete the video list @twilight2294 ? In desktop you can press on In case of mobile, just ensure that the selection is working as before, to be safe that everything is working the same |
still facing this issue , i have a fix ready it’s very late for me, i will update those and answer your questions above tomorrow |
|
I updated the PR @abzokhattab , you can continue with your checklist |
|
@abzokhattab typecheck failure seems to be unrelated here, you can continue with your review |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-11-06.at.19.54.03.movAndroid: mWeb ChromeScreen.Recording.2025-11-06.at.19.49.49.moviOS: HybridAppScreen.Recording.2025-11-06.at.19.54.03.moviOS: mWeb SafariScreen.Recording.2025-11-06.at.19.49.49.movMacOS: Chrome / SafariScreen.Recording.2025-11-06.at.19.29.31.movMacOS: DesktopScreen.Recording.2025-11-06.at.19.46.28.mov |
|
lets merge from main again it should be fixed now @twilight2294 |
|
Done! |
|
✋ 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/cead22 in version: 9.2.55-3 🚀
|
|
🚀 Deployed to staging by https://github.com/cead22 in version: 9.2.57-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.57-4 🚀
|
Explanation of Change
Fixed Issues
$ #73923
PROPOSAL: #73923 (comment)
Tests
Offline tests
QA Steps
Precondition: Workspace with members
Expect that No API call (
UpdateWorkspaceMembersRole) should be made if the selected role is the same as the existing one.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2025-11-07.at.5.40.07.PM.mov
Android: mWeb Chrome
Screen.Recording.2025-11-07.at.5.43.41.PM.mov
iOS: Native
Screen.Recording.2025-11-07.at.4.59.40.PM.mov
iOS: mWeb Safari
Screen.Recording.2025-11-07.at.5.01.58.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2025-11-04.at.10.28.21.PM.mov
MacOS: Desktop
Screen.Recording.2025-11-07.at.4.37.30.PM.mov