Exclude policy account logins from contact methods#93188
Conversation
Co-authored-by: Andrew Rosiclair <arosiclair@users.noreply.github.com>
Co-authored-by: Andrew Rosiclair <arosiclair@users.noreply.github.com>
|
🚧 @arosiclair has triggered a test Expensify/App build. You can view the workflow run here. |
|
Ad-hoc URL is https://93188.pr-testing.expensify.com/ |
This comment has been minimized.
This comment has been minimized.
|
@marcochavezf 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] |
| } | ||
| // Exclude synthetic Expensify Card domain logins (e.g. ...@expensify-policy<policyID>.exfy) auto-created for workspaces. | ||
| // These are not real contact methods and should never surface in the contact methods list or participant selectors. | ||
| if (CONST.REGEX.EXPENSIFY_POLICY_DOMAIN_NAME.test(login.partnerUserID)) { |
There was a problem hiding this comment.
❌ PERF-13 (docs)
CONST.REGEX.EXPENSIFY_POLICY_DOMAIN_NAME is a getter that allocates a new RegExp object on every access (see src/CONST/index.ts line 4974). Calling it inside the for...of loop means a new regex is constructed per iteration, even though the pattern is iterator-independent -- only the .test(login.partnerUserID) argument depends on the loop variable.
Hoist the regex before the loop:
const policyDomainRegex = CONST.REGEX.EXPENSIFY_POLICY_DOMAIN_NAME;
for (const login of Object.values(logins)) {
// ...
if (policyDomainRegex.test(login.partnerUserID)) {
continue;
}
// ...
}Reviewed at: 71e41f0 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
Co-authored-by: Andrew Rosiclair <arosiclair@users.noreply.github.com>
|
Fixed the failing Prettier check: the Note: the |
|
🚧 @arosiclair has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
…ntactMethods Exclude policy account logins from contact methods (cherry picked from commit e563a2f) (cherry-picked to staging by Julesssss)
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.4.4-3 🚀
Bundle Size Analysis (Sentry): |
Help site review — no changes requiredI reviewed the changes in this PR against the help site files under What this PR does: It filters out synthetic Expensify Card domain logins (e.g. Why no docs update is needed:
Since this is a display bug fix that restores the documented behavior (contact methods = real emails/phone numbers only), no draft help site PR was created. @arosiclair, please confirm you agree that no help site changes are required here. If you'd like documentation added or believe this changes a documented behavior, let me know and I'll create a draft help site PR. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.4-3 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 9.4.5-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.5-6 🚀
|
Explanation of Change
CreateWorkspacecreates a policy account with email+@expensify-policy{policyID}.exfyand a primary login for it. For some reason, the onyx updates for this primary login are being included in the API response (even though they are for a different account) so it shows in the contact methods page. This PR filters out those logins while we figure out the root problem behind the onyx updates being delivered incorrectly.Fixed Issues
Part of #93134
PROPOSAL: #93134 (comment)
Tests
…@expensify-policy<policyID>.exfyentry)Offline tests
None
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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