Repository navigation
[HOLD for payment 2025-02-05] [$250] Task - Task assignee is not assigned when creating task via [] @email <task name> #55564
Description
Activity
- addedBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2
on Jan 21, 2025 Triggered auto assignment to @kadiealexander (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.Proposal
Please re-state the problem that we are trying to solve in this issue.
Task - Task assignee is not assigned when creating task via [] @email
What is the root cause of that problem?
The
CONST.REGEX.TASK_TITLE_WITH_OPTONAL_SHORT_MENTIONregex does not properly match the groups in the text.App/src/pages/home/report/ReportFooter.tsx
Line 128 in 85c646c
const match = text.match(CONST.REGEX.TASK_TITLE_WITH_OPTONAL_SHORT_MENTION); What changes do you think we should make in order to solve the problem?
Firstly, update the
CONST.REGEX.TASK_TITLE_WITH_OPTONAL_SHORT_MENTIONregex to the one below.TASK_TITLE_WITH_OPTONAL_SHORT_MENTION: /^(\[\])\s+(@(?:(?=[\w'#%+-]+(?:\.[\w'#%+-]+)*@?)[\w.'#%+-]{1,64}(?:@(?:(?=[a-z\d]+(?:-+[a-z\d]+)*\.)(?:[a-z\d-]{1,63}\.)+[a-z]{2,63}))?))\s*([\s\S]*)/,Secondly, retrieve the mentioned text from the third, not the fourth group, and handle the extra
@character.App/src/pages/home/report/ReportFooter.tsx
Line 137 in 85c646c
const mention = match[1] ? match[1].trim() : ''; const mention = match[2] ? match[2].trim().slice(1) : '';What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Test
CONST.REGEX.TASK_TITLE_WITH_OPTONAL_SHORT_MENTIONwith some examples of comments that expect a task to be created.Proposal
Please re-state the problem that we are trying to solve in this issue.
The task regex doesn't work.
What is the root cause of that problem?
This starts happening after this PR. In that PR, we want to add the task title length validation, so the PR moves the regex to CONST to make it reusable.
Line 3127 in 0190b0a
TASK_TITLE_WITH_OPTONAL_SHORT_MENTION: `^\\[\\]\\s+(?:@(?:${EMAIL_WITH_OPTIONAL_DOMAIN}))?\\s*([\\s\\S]*)`, The regex concatenates with the
EMAIL_WITH_OPTIONAL_DOMAIN. However, the way it's being concatenated is wrong. If we see the code where the concatenation is first added, we take the regex source and concatenate it into the string instead of the whole regex object.
Notice from the image above, on the left (which is the current regex) has the
/.What changes do you think we should make in order to solve the problem?
Update the regex so it only concatenates with the
EMAIL_WITH_OPTIONAL_DOMAINsource.Line 3127 in 0190b0a
TASK_TITLE_WITH_OPTONAL_SHORT_MENTION: `^\\[\\]\\s+(?:@(?:${EMAIL_WITH_OPTIONAL_DOMAIN}))?\\s*([\\s\\S]*)`, EMAIL_WITH_OPTIONAL_DOMAIN.sourceWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
To be able to test it easily, I think we should move this logic to a util and test that util which returns the task title and/or assignee. Since there are a lot of cases, we will just handle the case of task regex with mention and title.
App/src/pages/home/report/ReportFooter.tsx
Lines 128 to 157 in 0190b0a
const match = text.match(CONST.REGEX.TASK_TITLE_WITH_OPTONAL_SHORT_MENTION); if (!match) { return false; } let title = match[3] ? match[3].trim().replace(/\n/g, ' ') : undefined; if (!title) { return false; } const mention = match[1] ? match[1].trim() : ''; const mentionWithDomain = ReportUtils.addDomainToShortMention(mention) ?? mention; const isValidMention = Str.isValidEmail(mentionWithDomain); let assignee: OnyxEntry<OnyxTypes.PersonalDetails>; let assigneeChatReport; if (mentionWithDomain) { if (isValidMention) { assignee = Object.values(allPersonalDetails ?? {}).find((value) => value?.login === mentionWithDomain) ?? undefined; if (!Object.keys(assignee ?? {}).length) { const assigneeAccountID = UserUtils.generateAccountID(mentionWithDomain); const optimisticDataForNewAssignee = Task.setNewOptimisticAssignee(mentionWithDomain, assigneeAccountID); assignee = optimisticDataForNewAssignee.assignee; assigneeChatReport = optimisticDataForNewAssignee.assigneeReport; } } else { // If the mention is not valid, include it on the title. // The mention could be invalid if it's a short mention and failed to be converted to a full mention. title = `@${mentionWithDomain} ${title}`; } } - addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Jan 23, 2025 - changed the title
[-]Task - Task assignee is not assigned when creating task via [] @email <task name>[/-][+][$250] Task - Task assignee is not assigned when creating task via [] @email <task name>[/+]on Jan 23, 2025 Job added to Upwork: https://www.upwork.com/jobs/~021882302358350245599
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Jan 23, 2025 Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (
External)I think we should go with @bernhardoj 's proposal. I agree with their diagnosis of the issue and the test plan also looks good to me.
🎀👀🎀 C+ reviewed
13 remaining items
- changed the title
[-][$250] Task - Task assignee is not assigned when creating task via [] @email <task name>[/-][+][HOLD for payment 2025-02-05] [$250] Task - Task assignee is not assigned when creating task via [] @email <task name>[/+]on Jan 29, 2025 Reviewinglabel has been removed, please complete the "BugZero Checklist".The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.90-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-02-05. 🎊
For reference, here are some details about the assignees on this issue:
- @bernhardoj requires payment through NewDot Manual Requests
- @eh2077 requires payment through NewDot Manual Requests
@eh2077 @kadiealexander @eh2077 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
BugZero Checklist:
- [Contributor] Classify the bug:
Bug classification
Source of bug:
- 1a. Result of the original design (eg. a case wasn't considered)
- 1b. Mistake during implementation
- 1c. Backend bug
- 1z. Other:
Where bug was reported:
- 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
- 2b. Reported on staging (eg. found during regression or PR testing)
- 2d. Reported on a PR
- 2z. Other:
Who reported the bug:
- 3a. Expensify user
- 3b. Expensify employee
- 3c. Contributor
- 3d. QA
- 3z. Other:
-
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/52941/files#r1941178581
-
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
-
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
-
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/467738
Regression Test Proposal
Precondition:
NA
Test:
- Open any chat
- Create a regex with assignee from composer (e.g., [] @example@gmail.com title)
- Verify the task is created with the correct assignee
Do we agree 👍 or 👎
- moved this from Bugs and Follow Up Issues to Hold for Payment in #expensify-bugs
on Feb 4, 2025 Payment Summary
- Reviewer: @bernhardoj owed $250 via NewDot
- Reviewer: @eh2077 owed $250 via NewDot
BugZero Checklist (@kadiealexander)
- I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
- I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1882302358350245599/hired)
- I have paid out the Upwork contracts or cancelled the ones that are incorrect
- I have verified the payment summary above is correct
Requested in ND.
$250 approved for @bernhardoj
$250 approved for @eh2077
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.88-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Action Performed:
task title and send it
Expected Result:
Task will be assigned to the tagged user
Actual Result:
Task is not assigned to the tagged user
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?
Screenshots/Videos
Add any screenshot/video evidence
Bug6699060_1734622590003.20241219_233101.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @kadiealexander