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-10-09] [$1000] Chat - If url ends with slash, then ending double quote is shown as link #24367

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 10, 2023 · 70 comments
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

@lanitochka17
Copy link

lanitochka17 commented Aug 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!


Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Tap on a report
  3. In compose, enter "om https://www.she.com/"
    "om https://www.she.com"
  4. Tap send

Expected Result:

Irrespective of url ends with/without slash, url alone must be displayed as link and not ending double quote

Actual Result:

If url ends with slash, then ending double quote is shown as link. If url ends without slash, then correctly url alone displayed as link

Workaround:

Unknown

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.52.3

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug6159871_double.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a579e05c4814caf9
  • Upwork Job ID: 1690052931685785600
  • Last Price Increase: 2023-08-11
  • Automatic offers:
    • situchan | Contributor | 26192821
    • Antasel | Contributor | 26634876
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 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

@rayane-djouah
Copy link
Contributor

rayane-djouah commented Aug 10, 2023

Proposal

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

When users input URLs in the chat application that end with a slash and then immediately close with a double quote, the application incorrectly includes the double quote as part of the URL link.

What is the root cause of that problem?

The root cause of this problem lies in the regex pattern used to detect URLs in the chat text. Specifically, the pattern in URL_PATH_REGEX does not exclude a trailing double quote " after a slash /, leading to incorrect URL detection.

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

To resolve this issue, we need to modify the URL_PATH_REGEX regex pattern in Url.js file to ensure it doesn't consider a trailing double quote as part of the URL. This can be achieved by adding a negative lookahead (?!") to the end of the regex pattern. The adjusted URL_PATH_REGEX is as follows:

const URL_PATH_REGEX = `(?:${addEscapedChar('[.,=(+$!*]')}?\\/${addEscapedChar('[-\\w$@.+!*:(),=%~]')}*${addEscapedChar('[-\\w~@:%)]')}|\\/)*(?!")`;

What alternative solutions did you explore? (Optional)

@greg-schroeder
Copy link
Contributor

@lanitochka17 can you clarify which platforms this occurs on?

@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Aug 11, 2023
@melvin-bot melvin-bot bot changed the title Chat - If url ends with slash, then ending double quote is shown as link [$1000] Chat - If url ends with slash, then ending double quote is shown as link Aug 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01a579e05c4814caf9

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

melvin-bot bot commented Aug 11, 2023

Current assignee @greg-schroeder is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

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

@gzqyl
Copy link

gzqyl commented Aug 12, 2023

Proposal

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

When users input URLs in the chat application that end with a slash and then immediately close with a double quote, the application incorrectly includes the double quote as part of the URL link.

What is the root cause of that problem?

the common lib parse links is not perfect, while it is very good enough, It does parse correct many url links with its regex rule

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

The other proposal is a right way to go, remove the "addEscapedChar" function will resolve the issue to some extent, however, it is still not perfect, the follow image shows the result by remove escape function.
Screenshot_1691995339
It is a little hard to get the same result as slack shows, stop at '"', and not others.

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Aug 12, 2023

📣 @gzqyl! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@gzqyl
Copy link

gzqyl commented Aug 12, 2023

Contributor details
Expensify account email: allen.gzqyl@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01e99782a01937e92c

@ShogunFire
Copy link
Contributor

ShogunFire commented Aug 13, 2023

I think the problem is to know what we want, do we accept quotes like this "" after the .com or not ? And do we accept escaped quotes like this: &quot; ? Because right now we are escaping the comment before testing the regexp... So I don't think we can have a different behaviour for " and for &quot; So what should be this behavior ?

On slack they have different behaviour for the two.

@melvin-bot melvin-bot bot added the Overdue label Aug 13, 2023
@ShogunFire
Copy link
Contributor

ShogunFire commented Aug 13, 2023

And in slack if you don't have a / &quot is not recognized either. If we want to remove both cases we should remove quot in this line:
https://github.com/Expensify/expensify-common/blob/1076899202ad338232a6cfeb4b242234aa932cb0/lib/Url.js#L6

@greg-schroeder
Copy link
Contributor

What do you think about the above, @parasharrajat?

@melvin-bot melvin-bot bot removed the Overdue label Aug 14, 2023
@parasharrajat
Copy link
Member

parasharrajat commented Aug 17, 2023

@situchan Feel free to continue reviewing this... I won't be able to review this soon..

cc: @greg-schroeder Please assign @situchan

@parasharrajat parasharrajat removed their assignment Aug 17, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 18, 2023

📣 @situchan 🎉 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 📖

@greg-schroeder
Copy link
Contributor

Sure - assigned you @situchan

@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

@greg-schroeder, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @situchan got assigned: 2023-08-18 08:23:06 Z
  • when the PR got merged: 2023-09-25 09:30:44 UTC
  • days elapsed: 26

On to the next one 🚀

@agilejune
Copy link

agilejune commented Sep 26, 2023

@greg-schroeder
I contacted his family. and there is policy to collect funds for a deceased freelancer’s estate on upwork.
I am sure you would release milestone for @Antasel 's work.
then his family can get funds via other payment method from upwork
Let me know if you released, then i will convey that to his family

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@greg-schroeder
Copy link
Contributor

greg-schroeder commented Sep 27, 2023

@agilejune thanks for letting me know. I will just process the issue normally and will let you know as we move towards payment

@Antasel already had an offer in Upwork and it was accepted, so we should be able to pay the account normally for the work he completed

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 2, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Chat - If url ends with slash, then ending double quote is shown as link [HOLD for payment 2023-10-09] [$1000] Chat - If url ends with slash, then ending double quote is shown as link Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 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 Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 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-10-09. 🎊

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 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:

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] 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:
  • [@situchan] 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:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] 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.
  • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@greg-schroeder
Copy link
Contributor

Sorry for delay, was OOO. Processing today.

@melvin-bot melvin-bot bot removed the Overdue label Oct 11, 2023
@situchan
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: N/A
  • 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: N/A
  • 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: N/A
  • Determine if we should create a regression test for this bug.
  • 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.

Automation test cases should cover regression test

@greg-schroeder
Copy link
Contributor

Payment summary:

Contributor: @Antasel $1000
C+: @situchan $1000

Paid out @agilejune fyi

@situchan
Copy link
Contributor

@greg-schroeder can you please check #24367 (comment)?

@greg-schroeder
Copy link
Contributor

will fire regression test using automation steps

@greg-schroeder
Copy link
Contributor

greg-schroeder commented Oct 12, 2023

oh yes @situchan sorry, forgot. will do now - done

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

10 participants