Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2023-11-22] [$500] Chat - App does not replace # on selection of mention #29187

Closed
6 tasks done
kbecciv opened this issue Oct 10, 2023 · 45 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Oct 10, 2023

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: 1.3.79.3
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
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696496817615989

Action Performed:

Precondition: User should know a user with # in display name

  1. Open the app
  2. Open any report
  3. Write '@#' and select the user in result
  4. Observe that app does not replace # with result

Expected Result:

On selecting user from mention result, app should replace search term with result

Actual Result:

On selecting user from mention result, app does not replace search term with result if term is '#'

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
android.native.mention.displaces.on.selection.mov
Android: mWeb Chrome
android.chrome.app.displaces.in.mention.mp4
iOS: Native
ios.safari.native.app.displaces.in.mention.mov
iOS: mWeb Safari
ios.safari.native.app.displaces.in.mention.mov
MacOS: Chrome / Safari
mac.chrome.desktop.app.displaces.in.mention.mov
MacOS: Desktop
mac.chrome.desktop.app.displaces.in.mention.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0159ee5a631ff4f0b0
  • Upwork Job ID: 1711736982382366720
  • Last Price Increase: 2023-11-01
  • Automatic offers:
    • fedirjh | Reviewer | 27547155
    • abzokhattab | Contributor | 27547156
    • dhanashree-sawant | Reporter | 27547157
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 10, 2023
@melvin-bot melvin-bot bot changed the title Chat - App does not replace # on selection of mention [$500] Chat - App does not replace # on selection of mention Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0159ee5a631ff4f0b0

@abzokhattab
Copy link
Contributor

abzokhattab commented Oct 10, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

The # is not replaced on the selection of the mention

What is the root cause of that problem?

we use the MENTION_REPLACER to get the comment after the mention, apparently, this regex terminates the matching upon encountering special characters, including "#," ,, this is declared in the SPECIAL_CHAR variable and used in MENTION_REPLACER, resulting in incomplete matches.

App/src/CONST.ts

Line 1297 in 830feaf

SPECIAL_CHAR: /[,/?"{}[\]()&^%;`$=#<>!*]/g,

App/src/CONST.ts

Lines 1314 to 1316 in 830feaf

get MENTION_REPLACER() {
return new RegExp(`^@[^\\n\\r]*?(?=$|\\s|${this.SPECIAL_CHAR.source}|${this.EMOJI.source})`, 'u');
},

What changes do you think we should make in order to solve the problem?

there is no need to use the MENTION_REPLACER in deciding the comment after the mention .. instead we can use the index of the last char of suggestionValues.mentionPrefix and fetch the string after it

i think it is easier to illustrate it by providing the code changes, so we should change this:

const commentAfterAtSignWithMentionRemoved = value.slice(suggestionValues.atSignIndex).replace(CONST.REGEX.MENTION_REPLACER, '');

To:

const commentAfterAtSignWithMentionRemoved = value.slice(suggestionValues.atSignIndex + suggestionValues.mentionPrefix.length + 1);

and of course, remove the MENTION_REPLACER from the const.ts file

POC:

Screen.Recording.2023-10-28.at.12.30.15.AM.mov

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Triggered auto assignment to @conorpendergrast (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (External)

@fedirjh
Copy link
Contributor

fedirjh commented Oct 13, 2023

Let's retest after #29239 is merged, as the regex structure will be changed in that PR.

@conorpendergrast conorpendergrast changed the title [$500] Chat - App does not replace # on selection of mention [Hold for PR 29239] [$500] Chat - App does not replace # on selection of mention Oct 13, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

@conorpendergrast, @fedirjh Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@conorpendergrast
Copy link
Contributor

Still waiting for #29239

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@conorpendergrast
Copy link
Contributor

PR is merged, waiting for it to be on Staging

@conorpendergrast
Copy link
Contributor

That PR is on Staging now (v1.3.86-0), so I retested.

This bug still exists, so I'll take it off hold!

image image

@conorpendergrast conorpendergrast changed the title [Hold for PR 29239] [$500] Chat - App does not replace # on selection of mention [$500] Chat - App does not replace # on selection of mention Oct 18, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Oct 18, 2023

@abzokhattab Can you please update your proposal ?

@abzokhattab
Copy link
Contributor

Proposal is updated please review and let me know

@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Oct 20, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Oct 22, 2023

@abzokhattab The bug can be reproduced with other special characters too. For example, the bug can be replicated with one of these characters `!@#$%^&*()_+{}[]|:\"<>.?/~$€£¥₹₽₣₪₩₴₱₨₦₭₮₵, and there may be other characters that cause the same issue.

@melvin-bot melvin-bot bot removed the Overdue label Oct 22, 2023
@abzokhattab
Copy link
Contributor

abzokhattab commented Oct 23, 2023

okay I thought we wanted to cover only the hashtag, but in this case, we need to remove the SPECIAL_CHAR matching completely.. in this case, the space or the new line would be the only characters that stop the matching

POC:

image image

@fedirjh
Copy link
Contributor

fedirjh commented Oct 23, 2023

we need to remove the SPECIAL_CHAR matching completely

Hmmm, there must have been a specific reason for that implementation in the past. Was it done to resolve another bug?

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

@conorpendergrast @fedirjh this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@abzokhattab
Copy link
Contributor

A kindly reminder on this

@melvin-bot melvin-bot bot added the Overdue label Nov 5, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Nov 6, 2023

We are currently awaiting final approval from cc @marcochavezf.

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2023
@marcochavezf
Copy link
Contributor

Thanks for the review @fedirjh, the proposed solution looks good. Assigning @abzokhattab 🚀

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 6, 2023

📣 @abzokhattab 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

Copy link

melvin-bot bot commented Nov 6, 2023

📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 6, 2023
@abzokhattab
Copy link
Contributor

Kindly reminder, @fedirjh @conorpendergrast ... PR is ready

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 15, 2023
@melvin-bot melvin-bot bot changed the title [$500] Chat - App does not replace # on selection of mention [HOLD for payment 2023-11-22] [$500] Chat - App does not replace # on selection of mention Nov 15, 2023
Copy link

melvin-bot bot commented Nov 15, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 15, 2023
Copy link

melvin-bot bot commented Nov 15, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.99-0 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 2023-11-22. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 15, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] A discussion in #expensify-bugs 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@conorpendergrast] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 22, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Nov 22, 2023

BugZero Checklist:

@conorpendergrast
Copy link
Contributor

conorpendergrast commented Nov 23, 2023

Payouts due:

Upwork job is here.

@conorpendergrast
Copy link
Contributor

All paid now, and I agree with you @fedirjh for the C+ checklist. Closing out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants