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-08-01] [$1000] App allows to add link in code block and does not display the same on copy and send #22492

Closed
6 tasks done
kavimuru opened this issue Jul 8, 2023 · 38 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 Jul 8, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Open any report
  3. Send link in following format : Test
  4. Observe that it displays link inside code block (till now, we have intentionally made sure to not display link in code block)
  5. Hover and click on copy to clipboard
  6. Paste in compose box and send
  7. Observe that now, it does not display link in code block

Expected Result:

App should not display link inside code block and maintain same display format on copy to clipboard and send again as message

Actual Result:

App displays link inside code block if sent in specific format and on copy to clipboard and sending as normal message, it does not maintain the format

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.38-2
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

link.in.code.block.and.not.maintaining.format.mp4
Recording.1224.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f921043b5d238f9f
  • Upwork Job ID: 1678721695254556672
  • Last Price Increase: 2023-07-11
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 8, 2023
@eh2077
Copy link
Contributor

eh2077 commented Jul 8, 2023

Proposal

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

App allows to add link in code block and does not display the same on copy and send.

What is the root cause of that problem?

The following markdown input

[```code```](google.com)

is translated into html

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

from frontend by method ExpensiMark.replace applying code fence rule and link rule.

The backend corrects the above html into following html

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

which is translated into following markdown when clicking to edit the comment

```
[code](https://google.com)
```

Note the starting and ending anchor tag, <a href="https://google.com" target="_blank" rel="noreferrer noopener"></a>, are same and translated into empty string.

So, the root cause of this issue is that the link rule doesn't skip to translate markdown link syntax if its alias text inside [] contains code fence tag <pre>.

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

To fix this issue, we should avoid translating link markdown syntax if its alias text part contains <pre> tag.

To achieve it, we can change following condition

https://github.com/Expensify/expensify-common/blob/d636fef3f22b4e5fcf61333ddc89a5d2e08cacc9/lib/ExpensiMark.js#L454

of method modifyTextForUrlLinks by checking if the alias text part, match[1], includes <pre> tags

if (abort || match[1].includes('<pre>')) {

to skip replacing link syntax to html.

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Jul 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 8, 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 Jul 10, 2023
@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label Jul 11, 2023
@melvin-bot melvin-bot bot changed the title App allows to add link in code block and does not display the same on copy and send [$1000] App allows to add link in code block and does not display the same on copy and send Jul 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

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

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

Reviewed, adding external.

@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

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

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 13, 2023
@thesahindia
Copy link
Member

@eh2077's proposal looks good!

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

Triggered auto assignment to @hayata-suenaga, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@hayata-suenaga
Copy link
Contributor

I'm not familiar with ExpensiMark 😓, so I gonna trust your assessment @thesahindia

assigning @eh2077

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

melvin-bot bot commented Jul 14, 2023

📣 @thesahindia Please request via NewDot manual requests for the Reviewer role ($1000)

@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

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

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 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

📣 @dhanashree! 📣
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>

@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

The BZ member will need to manually hire dhanashree for the Reporter role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!

@eh2077
Copy link
Contributor

eh2077 commented Jul 17, 2023

@thesahindia The PR Expensify/expensify-common#558 for expensify-common is ready for review.

@hayata-suenaga
Copy link
Contributor

@Antasel thank you very much for sharing your detailed thoughts. If you think there is still an issue left, could you post your finding as a bug report? Otherwise, @eh2077 is already working on it and we gonna go with their proposal 🙇

@Antasel
Copy link
Contributor

Antasel commented Jul 21, 2023

ok, i am just gonna contribute more improved solution. thanks for your reply

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 25, 2023
@melvin-bot melvin-bot bot changed the title [$1000] App allows to add link in code block and does not display the same on copy and send [HOLD for payment 2023-08-01] [$1000] App allows to add link in code block and does not display the same on copy and send Jul 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.44-2 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-08-01. 🎊

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:

  • @thesahindia does not require payment (Eligable for Manual Requests)
  • @eh2077 requires payment

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

This comment was marked as duplicate.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 31, 2023
@zanyrenney
Copy link
Contributor

zanyrenney commented Aug 1, 2023

Invites have been sent to @eh2077 @thesahindia and @dhanashree but we are still waiting on them to accept. The final step is payment. I am going OOO so please can you pay out these? Thank you BZ team member!

@zanyrenney zanyrenney removed their assignment Aug 1, 2023
@zanyrenney zanyrenney added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

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

@melvin-bot

This comment was marked as duplicate.

@zanyrenney zanyrenney self-assigned this Aug 1, 2023
@dhanashree-sawant
Copy link

Thanks @zanyrenney, @Christinadobrzyn,
Invite accepted.

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Aug 1, 2023

Ready for payment

@thesahindia should we have a regression test for this?

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Aug 3, 2023

nudge @thesahindia about a regression test for this

@Christinadobrzyn
Copy link
Contributor

Paying out in Upwork - https://www.upwork.com/jobs/~01f921043b5d238f9f

@dhanashree-sawant paid through Upwork for reporting the bug $250
@eh2077 paid through Upwork for contributor work $1000 + $500 speed bonus
@thesahindia paid through NewExpensify $1000 + $500 speed bonus

@thesahindia
Copy link
Member

Sorry for the delay here are the steps -

  1. Go to a chat and add following comment
[```code```](google.com)
  1. Verify that only code is displayed as code block and link google.com is displayed as auto link.
  2. Edit the comment and verify the initial draft is
Screenshot 2023-08-07 at 2 02 31 AM

@thesahindia
Copy link
Member

@thesahindia paid through NewExpensify $1000 + $500 speed bonus

Actually I haven't got paid yet. I still need to add my bank account at old dot (having some issues). But this issue is in my list so we can close it, I will request payment soon.

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Aug 7, 2023

Thanks @thesahindia - let me know if you need any help with the payment stuff through New Expensify

Created Regression Test - https://github.com/Expensify/Expensify/issues/306418
Closing this GH

@JmillsExpensify
Copy link

$1,500 payment approved for @thesahindia based on BZ summary.

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