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-05-29] [$1000] Editing link removes the link #18514

Closed
6 tasks done
kavimuru opened this issue May 5, 2023 · 44 comments
Closed
6 tasks done

[HOLD for payment 2023-05-29] [$1000] Editing link removes the link #18514

kavimuru opened this issue May 5, 2023 · 44 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 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented May 5, 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. Open the app
  2. Open any report
  3. Send any link eg: Google.com
  4. Edit the link part, keep the text same just make any letter capital or small eg: [Google.com](google.com)

Expected Result:

App should keep the edited message as link

Actual Result:

App removes the edited message as link

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.11-4
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

app.removes.edited.message.as.link.on.new.staging.mp4
Recording.503.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683277952189849

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0145804dc44340d929
  • Upwork Job ID: 1656788307683254272
  • Last Price Increase: 2023-05-11
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 5, 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 melvin-bot bot added the Overdue label May 8, 2023
@arielgreen arielgreen added the Needs Reproduction Reproducible steps needed label May 8, 2023
@arielgreen
Copy link
Contributor

Cannot reproduce today.
2023-05-08_13-10-43 (1)

@melvin-bot melvin-bot bot removed the Overdue label May 8, 2023
@dhanashree-sawant
Copy link

dhanashree-sawant commented May 9, 2023

Hi @arielgreen, there are 2 mistakes in your reproduction steps:

  1. Keep link and alias same i.e. google.com
  2. Edit link part not the alias part i.e. google.com

This video should be helpful for better understanding

2023-05-09.07-49-12.mp4

@strepanier03
Copy link
Contributor

I was doing some work to create a non-reproducible bug triaging process and came across this GH while searching by the Needs Reproduction label.

@arielgreen I'm going to reopen this because the issue is reproducible following the steps. You just have to be sure you change the link part, not the name part.

2023-05-10_10-38-45.mp4

@strepanier03 strepanier03 reopened this May 10, 2023
@eh2077
Copy link
Contributor

eh2077 commented May 11, 2023

I can also reproduce this issue though the original reproduction steps are a little bit unclear. I'd like to post a proposal for it.

cc @arielgreen @strepanier03

@eh2077
Copy link
Contributor

eh2077 commented May 11, 2023

Proposal

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

Edit website to capital letters removes the link.

What is the root cause of that problem?

An autolink comment, like Google.com, is parsed into anchor tag

<a href="https://Google.com" target="_blank" rel="noreferrer noopener">Google.com</a>

Click to edit the link and it's parsed to markdown

[Google.com](https://Google.com)

If edit the above markdown(changing the capital letter 'G' to lower case) into

[Google.com](https://google.com)

Then we'll indentify the link is removed in method getRemovedMarkdownLinks because https://Google.com is different from https://google.com in case sensitive comparing.

Note that domain names are case insensitive according to RFC 4343 , see this SO discussion. So the root cause of the issue is that we don't aware the link is not changed if only changing uppper or lower case letters of domain.

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

To fix this issue, I think we can

  1. Format the domain of link to lower case just like what we do for the schema https, see here and here.
  2. Skip removing link in method getRemovedMarkdownLinks if only changing uppper or lower case letters of domain.

To achieve this, we can use the website regex to capture the website(including protocol and domain) which is case insensitive.

So we can

  1. Format the website to lower case when translating markdown to html in link-to-html-rule and autolink-to-html-rule. For example, we can add a group to capture website in URL_REGEX by changing this line

    const URL_REGEX = `(${URL_WEBSITE_REGEX}${URL_PATH_REGEX}(?:${URL_PARAM_REGEX}|${URL_FRAGMENT_REGEX})*)`;

    to

    const URL_REGEX = `((${URL_WEBSITE_REGEX})${URL_PATH_REGEX}(?:${URL_PARAM_REGEX}|${URL_FRAGMENT_REGEX})*)`;

    See below picture, group 3 captures the website which needs to be converted to lower case.

    image
  2. Use the website regex to capture and replace website of edited link to lower case and then compare with the origial link in method getRemovedMarkdownLinks.

What alternative solutions did you explore? (Optional)

N/A

@arielgreen arielgreen added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels May 11, 2023
@melvin-bot melvin-bot bot changed the title Editing link removes the link [$1000] Editing link removes the link May 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0145804dc44340d929

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

Current assignee @arielgreen is eligible for the External assigner, not assigning anyone new.

@arielgreen
Copy link
Contributor

Great, thanks for the clarification, all.

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

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

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

melvin-bot bot commented May 11, 2023

Triggered auto assignment to @MariaHCD (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@fedirjh
Copy link
Contributor

fedirjh commented May 15, 2023

Thanks for the proposal @eh2077 , your analysis are correct and your solution looks perfect.

cc @MariaHCD, This proposal looks good to me.

🎀 👀 🎀 C+ reviewed

@MariaHCD
Copy link
Contributor

Looks good to me too

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

@fedirjh @dhanashree-sawant @eh2077 offers sent in Upwork

@eh2077
Copy link
Contributor

eh2077 commented May 23, 2023

@arielgreen Accepted. Thank you!

@dhanashree-sawant
Copy link

Hi @arielgreen, thanks, I have also accepted the offer.

@arielgreen
Copy link
Contributor

Thanks folks! @fedirjh please also be sure to fill out the checklist above.

@arielgreen arielgreen removed the Bug Something is broken. Auto assigns a BugZero manager. label May 26, 2023
@arielgreen
Copy link
Contributor

Reassigning, OOO tomorrow/Monday.

@arielgreen arielgreen added the Bug Something is broken. Auto assigns a BugZero manager. label May 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 26, 2023
@melvin-bot

This comment was marked as duplicate.

@trjExpensify
Copy link
Contributor

Cool, happy to help! @fedirjh, let us know about that checklist. :)

@fedirjh
Copy link
Contributor

fedirjh commented May 28, 2023


  1. Open the App.
  2. Navigate to any chat.
  3. Send a message containing a link: [google.com](http://google.com/).
  4. Long-press the message and click on "Edit message."
  5. Edit the domain part of the link, while keeping the text the same but changing the capitalization of the domain letters. For example, change [google.com](http://google.com/) to [google.com](http://Google.COM/).
  6. Verify that the message is still displayed as a link, and the domain part maintains its original capitalization.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Daily KSv2 labels May 29, 2023
@MariaHCD
Copy link
Contributor

MariaHCD commented Jun 1, 2023

Those regression steps look good to me!

@eh2077 @trjExpensify what do you think?

@melvin-bot melvin-bot bot removed the Overdue label Jun 1, 2023
@trjExpensify
Copy link
Contributor

@fedirjh - you have access to TestRail as a C+, right?

Wouldn't we just modify this existing test case instead of adding a new one entirely?

So from #7 onwards..

  1. Send a message that includes a hyperlink i.e [google.com](http://google.com/)
  2. Edit the message with the hyperlink (do not modify the link) and save the changes
  3. Verify the link is still hyperlinked in the modified message
  4. Now edit the domain part of the link, while keeping the text the same but changing the capitalization of the domain letters i.e [google.com](http://Google.COM/)
  5. Verify the link is still hyperlinked in the modified message and the domain part maintains its original capitalization
  6. As the other user in the conversation, Verify the edited message is displaying the new text and has a "(edited)" status in the conversation history

@trjExpensify
Copy link
Contributor

We're ready for payment here, confirming these from the offers sent:

$1,000 - @fedirjh for C+ review
$1,000 - @eh2077 for the fix
$250 - @dhanashree-sawant for the bug report

@eh2077
Copy link
Contributor

eh2077 commented Jun 1, 2023

@trjExpensify Thanks for checking this! I think it's eligible for speed bonus. See below timeline FYI
Assigned: datetime="2023-05-15T14:01:23Z"
Merged: datetime="2023-05-18T06:54:24Z"

@trjExpensify
Copy link
Contributor

Awesome, amended offers and settled up with each of you!

@trjExpensify
Copy link
Contributor

@fedirjh @MariaHCD - let me know what you think about this and I'll create an issue for Applause.

@fedirjh
Copy link
Contributor

fedirjh commented Jun 1, 2023

you have access to TestRail as a C+, right?

@trjExpensify Actually NO , I don’t have access to TestRail. Should I request access on the C+ channel ?

@trjExpensify
Copy link
Contributor

I can check on that, maybe you don't get access anymore.

@trjExpensify
Copy link
Contributor

Ah okay, so confirmed we didn't provide C+ access. Created an issue for Applause to look at. We're done here, closing!

@MariaHCD
Copy link
Contributor

MariaHCD commented Jun 2, 2023

Thanks @trjExpensify! Editing the existing test case as you outlined here makes sense to me!

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants