Skip to content

[HOLD for payment 2023-10-09] [$1000] Chat - If url ends with slash, then ending double quote is shown as link #24367

Closed

Description

@lanitochka17

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

Activity

  1. added
    Daily
    Bug
    on Aug 10, 2023
  2. melvin-bot commented on Aug 10, 2023

    @melvin-bot

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

  3. melvin-bot commented on Aug 10, 2023

    @melvin-bot

    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
  4. rayane-d commented on Aug 10, 2023

    @rayane-d
    Contributor

    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)

  5. greg-schroeder commented on Aug 11, 2023

    @greg-schroeder
    Contributor

    @lanitochka17 can you clarify which platforms this occurs on?

  6. added
    External
    on Aug 11, 2023
  7. 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[/+] on Aug 11, 2023
  8. melvin-bot commented on Aug 11, 2023

    @melvin-bot
  9. added
    Help Wanted
    on Aug 11, 2023
  10. melvin-bot commented on Aug 11, 2023

    @melvin-bot

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

  11. melvin-bot commented on Aug 11, 2023

    @melvin-bot

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

  12. gzqyl commented on Aug 12, 2023

    @gzqyl

    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

  13. 81 remaining items

  14. melvin-bot commented on Oct 2, 2023

    @melvin-bot

    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
  15. melvin-bot commented on Oct 2, 2023

    @melvin-bot

    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:
  16. added
    Daily
    and removed
    Weekly
    Daily
    on Oct 9, 2023
  17. greg-schroeder commented on Oct 11, 2023

    @greg-schroeder
    Contributor

    Sorry for delay, was OOO. Processing today.

  18. situchan commented on Oct 11, 2023

    @situchan
    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

  19. greg-schroeder commented on Oct 12, 2023

    @greg-schroeder
    Contributor

    Payment summary:

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

    Paid out @agilejune fyi

  20. situchan commented on Oct 12, 2023

    @situchan
    Contributor

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

  21. greg-schroeder commented on Oct 12, 2023

    @greg-schroeder
    Contributor

    will fire regression test using automation steps

  22. greg-schroeder commented on Oct 12, 2023

    @greg-schroeder
    Contributor

    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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions