Repository navigation
Normalize phone receiver login with SMS domain in SendInvoice - #100892
Conversation
SendInvoice was sending raw phone numbers (e.g. +918375818341) as receiverEmail instead of the normalized SMS login (+918375818341@expensify.sms). This caused Auth to return 'Invalid invoice receiver' (jsonCode 666), triggering failure data and an error banner on the optimistic invoice room. - Import addSMSDomainIfPhoneNumber in SendInvoice.ts - Normalize receiver.login via addSMSDomainIfPhoneNumber in getSendInvoiceInformation for both optimistic personal details and existing participant flows - Normalize receiverEmail API parameter in sendInvoice - Add unit test verifying phone receiver login gets SMS domain appended
…participant and personal details matching
… in SendInvoice.ts
…sure availability for optimistic personal details
|
@Krishna2323 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_hybrid.mp4Android: mWeb Chromeandroid_mWeb.mp4iOS: HybridAppios_hybrid.mp4iOS: mWeb Safariios_mWeb.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.78-0 🚀
|
|
🤖 No help site changes are required for this PR, so I did not create a draft docs PR. Why: This is a bug fix with no user-facing behavior or copy change. It normalizes a phone receiver's login to the SMS format ( The help site already documents phone recipients as supported, so the docs described the intended behavior all along:
What I checked
If you'd still like a docs update — for example, an FAQ entry clarifying that phone recipients receive invoices by text — reply with @ashu75575, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR view run · no recording available |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.4.78-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
SendInvoicewas sending a raw phone number (e.g.,+918375818761) asreceiverEmailinstead of the normalized SMS login (+918375818341@expensify.sms). Every sibling flow (SendMoney,Split,PerDiem,MoneyRequestBuilder) normalizes phone receivers throughaddSMSDomainIfPhoneNumber, butSendInvoicewas the outlier.Without the
@expensify.smsdomain, Auth returns{ "jsonCode": 666, "message": "Invalid invoice receiver" }, which triggersfailureDataand writeserrorFields.createChaton the optimistic invoice room.Changes:
addSMSDomainIfPhoneNumberfrom@libs/PhoneNumberinSendInvoice.ts.addSMSDomainIfPhoneNumber(receiverParticipant.login)so that it applies uniformly whether we are creating an optimistic personal detail or falling back on an existing participant.should normalize phone receiver login with SMS domainto verify thatAPI.writeis called with the correctly formattedreceiverEmail(e.g.,+918375818761@expensify.sms).Fixed Issues
$ #97203
PROPOSAL: #97203
Tests
+918375818761) who has no existing Expensify accountOffline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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.2026-09-11.at.5.40.09.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-09-11.at.7.20.00.PM.mov
iOS: Native
Screen.Recording.2026-09-11.at.6.24.12.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-09-11.at.7.34.36.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-09-11.at.7.28.28.PM.mov