You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Awaiting C+ payment] [HOLD for payment 2023-07-24] [$1000] Phone number contact in task assignee is displayed with @expensify.sms #22050
Search for user with phone number as default contact method and select it
Observe that on new task page under assignee, the phone number contact is displayed with @expensify.sms in the end
Expected Result:
App should display phone number contact below assignee in new format as it displays in assignee search
Actual Result:
App displays phone number contact in old format and with @expensify.sms behind it below assignee
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.35-5 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
What changes do you think we should make in order to solve the problem?
We can sanitize it with LocalePhoneNumber.formatPhoneNumber(assignee.subtitle) to get only phone number. We can do the same for shareDestination in the next MenuItem as well.
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
Phone number contact in task assignee is displayed with @expensify.sms
What is the root cause of that problem?
Assignee object on confirm task page has the following structure:
{displayName: ......,// display name of the usericons: [{ source, type, name }],subtitle: .....,// login of the user}
Root cause of the issue is that when on confirm task page we render the menu items for different fields like title, description, assignee, share somewhere then for assignee menu item we are directly sending the subtitle field without applying any filter.
Problem with this is that this works fine for the user with email type login but when the user has phone type login, subtitle field will have our sms domain at the end at subtitle will end with @expensify.sms. And in case of phone login, we are removing the sms domain in our app which we didn't do here
What changes do you think we should make in order to solve the problem?
We have a method specifically created in our common library expensify-common which goes by the name removeSMSDomain defined here
Points to note: the method only edits the string if it contains sms domain that means it doesn't affect the emails
Cases:
user has email login
Whatever above condition returns, we will have no issue because in case it returns true, we display subtitle which is his email, and if its false, we apply remove domain method but it doesnt affect emails.
user has phone login (main case)
His subtitle field will be of the format +(country-code)(mobile)@expensify.sms
Here user's display name will always be different from subtitle because if user has not set display name, then display name would be of the form 0(mobile) and if user has set his display name then he can never set his display name equal to the subtitle field because display name does not allow +, @, .
So in this caase, our condition will always be false and we will always run the removeSMSDomain method which will remove @expensify.sms from the subtitle.
So compiling everything explained above, essential changes in our NewTaskPage would look like
At the time of submission, No other proposal has given this solution
Resultsbandicam.2023-07-02.13-47-18-103.mp4
What alternative solutions did you explore? (Optional)
We could also use formatPhoneNumber but that method will cause inconsistency since it will turn the description field into display name and ideally title should have display name and subtitle should have login. Note that we have used formatPhoneNumber for creating default display name for the users who have not set their display name like this 012345 56789
Looks like something related to react-navigation may have been mentioned in this issue discussion.
As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.
Yup, this is reproducible. As we do elsewhere throughout the app, we shouldn't be showing the @expensify.sms portion of the phone number login. Let's not reinvent the wheel and extend however we're doing that elsewhere here on the taskReport.
@thienlnam putting this on your radar as well, as it relates to tasks. Going to move it External for the time being.
changed the title [-]Phone number contact in task assignee is displayed with @expensify.sms[/-][+][$1000] Phone number contact in task assignee is displayed with @expensify.sms[/+]on Jul 4, 2023
There must be some new change that caused it.
When this was reported, I here and @rushatgabhanehere checked and confirmed that the task preview does not have @expensify.sms. I did not make any video for this.
I think some other recent change caused this. @bondydaa
ah thanks for that context! if you can find which PR might have caused it then great! we can tie it to that but otherwise we can get it handled on the new GH that gets spun up.
Activity
melvin-bot commentedon Jul 2, 2023
Triggered auto assignment to @trjExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 2, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)c3024 commentedon Jul 2, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Subtext in assignee shows @expensify.sms at the end
What is the root cause of that problem?
The text displayed is the
descriptionfor assigneeMenuIteminNewTaskPagewhich issubtitlethat comes like @expensify.sms for BE.https://github.com/Expensify/App/blob/c0ece67e0edcb725d8f72cf57cd40d98854c552c/src/pages/tasks/NewTaskPage.js#L161C1-L164C121
What changes do you think we should make in order to solve the problem?
We can sanitize it with
LocalePhoneNumber.formatPhoneNumber(assignee.subtitle)to get only phone number. We can do the same forshareDestinationin the nextMenuItemas well.What alternative solutions did you explore? (Optional)
namhihi237 commentedon Jul 2, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
Show the assigned task here we are getting the original:
App/src/components/ReportActionItem/TaskPreview.js
Lines 61 to 62 in c0ece67
What changes do you think we should make in order to solve the problem?
So we need to reformat like:
Result:

What alternative solutions did you explore? (Optional)
N/A
chiragxarora commentedon Jul 2, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Phone number contact in task assignee is displayed with @expensify.sms
What is the root cause of that problem?
Assignee object on confirm task page has the following structure:
Root cause of the issue is that when on confirm task page we render the menu items for different fields like title, description, assignee, share somewhere then for assignee menu item we are directly sending the subtitle field without applying any filter.
App/src/pages/tasks/NewTaskPage.js
Lines 161 to 168 in c0ece67
Problem with this is that this works fine for the user with email type login but when the user has phone type login, subtitle field will have our sms domain at the end at subtitle will end with
@expensify.sms. And in case of phone login, we are removing the sms domain in our app which we didn't do hereWhat changes do you think we should make in order to solve the problem?
We have a method specifically created in our common library
expensify-commonwhich goes by the nameremoveSMSDomaindefined herehttps://github.com/Expensify/expensify-common/blob/52e551cae863ca0a4ec7be8b1ae9b0dee90632e7/lib/str.js#L956-L958
And we have used this method all over our app and we shall use this here too.
We need a conditional statement to distinguish between email login and phone login and that we can do by comparing
displayNameandsubtitlelike thisWhy this works?
Points to note: the method only edits the string if it contains sms domain that means it doesn't affect the emails
Cases:
Whatever above condition returns, we will have no issue because in case it returns true, we display subtitle which is his email, and if its false, we apply remove domain method but it doesnt affect emails.
His subtitle field will be of the format
+(country-code)(mobile)@expensify.smsHere user's display name will always be different from subtitle because if user has not set display name, then display name would be of the form
0(mobile)and if user has set his display name then he can never set his display name equal to the subtitle field because display name does not allow+,@,.So in this caase, our condition will always be false and we will always run the removeSMSDomain method which will remove
@expensify.smsfrom the subtitle.So compiling everything explained above, essential changes in our
NewTaskPagewould look likeAt the time of submission, No other proposal has given this solution
Results
bandicam.2023-07-02.13-47-18-103.mp4
What alternative solutions did you explore? (Optional)
We could also use
formatPhoneNumberbut that method will cause inconsistency since it will turn the description field into display name and ideally title should have display name and subtitle should have login. Note that we have usedformatPhoneNumberfor creating default display name for the users who have not set their display name like this012345 56789melvin-bot commentedon Jul 2, 2023
Looks like something related to
react-navigationmay have been mentioned in this issue discussion.As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our
DeprecatedCustomActions.jsfiles should not be accepted.Feel free to drop a note in #expensify-open-source with any questions.
trjExpensify commentedon Jul 4, 2023
Yup, this is reproducible. As we do elsewhere throughout the app, we shouldn't be showing the
@expensify.smsportion of the phone number login. Let's not reinvent the wheel and extend however we're doing that elsewhere here on the taskReport.@thienlnam putting this on your radar as well, as it relates to tasks. Going to move it
Externalfor the time being.[-]Phone number contact in task assignee is displayed with @expensify.sms[/-][+][$1000] Phone number contact in task assignee is displayed with @expensify.sms[/+]melvin-bot commentedon Jul 4, 2023
Job added to Upwork: https://www.upwork.com/jobs/~010ead72a986dba400
melvin-bot commentedon Jul 4, 2023
Current assignee @trjExpensify is eligible for the External assigner, not assigning anyone new.
73 remaining items
rushatgabhane commentedon Aug 10, 2023
I've been paid. we can close 😅
trjExpensify commentedon Aug 10, 2023
Dope!
bondydaa commentedon Aug 31, 2023
as reported here https://expensify.slack.com/archives/C049HHMV9SM/p1692114818807249
looks like either this wasn't fully fixed by #22566 or there is a new regression
quickly looking at the PR I don't see any screenshots or videos that show the task preview so we might have just missed it 🤦
Going to spin up a new issue for this.
c3024 commentedon Aug 31, 2023
There must be some new change that caused it.
When this was reported, I here and @rushatgabhane here checked and confirmed that the task preview does not have @expensify.sms. I did not make any video for this.
I think some other recent change caused this. @bondydaa
bondydaa commentedon Aug 31, 2023
ah thanks for that context! if you can find which PR might have caused it then great! we can tie it to that but otherwise we can get it handled on the new GH that gets spun up.
kbecciv commentedon Sep 12, 2023
Yes, we have another issue reported by Contributor
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694333604061429
@bondydaa Let me know if I need a separate GH ticket.
Screen.Recording.2023-08-15.at.22.54.24.mov
trjExpensify commentedon Sep 12, 2023
@bondydaa where is that? Let's not reopen this one that's already done and dusted with payments made.
kbecciv commentedon Sep 13, 2023
Created a new issue here #27330, closing old one.