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

[$500] Web - When we send link with multiple ending parenthesis the link ends in the middle #26788

Closed
1 of 6 tasks
kbecciv opened this issue Sep 5, 2023 · 45 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Sep 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. Go to any report
  2. Send a link with multiple umatched closing parenthesis that are not all at the end, for example: google.com/(toto))titi)

Expected Result:

The link should end after google.com/(toto) because the first unmatched parenthesis is probably not part of the link, for example it could be the parenthesis closing the markdown: google.com/(toto)

Actual Result:

The link ends after the unmatched parenthesis at a weird place

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

2023-08-31.06-49-03.mp4
Recording.4277.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ShogunFire
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693485959926909

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010ba033b476889ccc
  • Upwork Job ID: 1700291645262581760
  • Last Price Increase: 2023-09-08
  • Automatic offers:
    • ShogunFire | Contributor | 26746827
    • ShogunFire | Reporter | 26746828
Issue OwnerCurrent Issue Owner: @robertKozik
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

@melvin-bot
Copy link

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

@kbecciv
Copy link
Author

kbecciv commented Sep 5, 2023

Proposal by: @ShogunFire
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693485959926909

Proposal

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

The link look wrong when we send a link with multiple closing parenthesis.

What is the root cause of that problem?

We remove extra closing parenthesis from links here: https://github.com/Expensify/expensify-common/blob/7735de14112a968fd6a4f5af710d2fbaefc8809d/lib/ExpensiMark.js#L456-L471
But the way we do it is wrong because we just count the number of extra parenthesis x and then remove x characters from the link without checking if the closing parenthesis are at the end or not.

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

We should remove every characters after an unmatched closing parenthesis
This is the code I propose:

// remove everything characters after an unmatched ) parenthese (including the parenthese)
let brace = 0;
for (let i = 0; i < match[2].length; i++) {
    if (match[2][i] === '(') {
        brace++;
    }
    if (match[2][i] === ')') {
        if(brace <= 0){ // unmatched closing parenthesis
            const numberOFCharsToRemove = match[2].length - i;
            match[0] = match[0].substr(0, match[0].length - numberOFCharsToRemove);
            match[2] = match[2].substr(0, match[2].length - numberOFCharsToRemove);
            break;
        }
        brace--;
    }
}

What alternative solutions did you explore? (Optional)

@alexpensify
Copy link
Contributor

When I was reviewing for dupes, I found this GH: #25532 (comment)

@ShogunFire are you addressing this issue in that GH listed above? I see you included similar links.

cc: @MonilBhavsar and @0xmiroslav

@ShogunFire
Copy link
Contributor

@alexpensify I found this issue while resolving the other one but I believe this is a different issue. The other one is about removing special characters from the url that we are not currently removing.
This one is about a problem with how we remove the end parenthesis currently.

@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label Sep 8, 2023
@melvin-bot melvin-bot bot changed the title Web - When we send link with multiple ending parenthesis the link ends in the middle [$500] Web - When we send link with multiple ending parenthesis the link ends in the middle Sep 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

Job added to Upwork: https://www.upwork.com/jobs/~010ba033b476889ccc

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

melvin-bot bot commented Sep 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

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

@alexpensify
Copy link
Contributor

Thanks for the feedback @ShogunFire!

@robertKozik could you please review the proposal and identify if it will resolve this issue? Thanks!

@ShogunFire
Copy link
Contributor

I couldn't edit my proposal but another approach that I put in the slack thread is to remove the unmatched end parenthesis only if they are at the end but I don't recomment it.

@khanumar03
Copy link

hi is issue still open ?

@melvin-bot
Copy link

melvin-bot bot commented Sep 9, 2023

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

@khanumar03
Copy link

khanumar03 commented Sep 9, 2023

@alexpensify @ShogunFire! so we want to normalize parenthesis ?

@MonilBhavsar
Copy link
Contributor

@alexpensify I prefer having two issues separate. We're discussing in the other issue.

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@robertKozik
Copy link
Contributor

Hi all! Thanks for proposal @ShogunFire, I've checked it and it solves the issue. If we are ok with reducing the link to the first unmatched parenthesis, proposal is good to go

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 13, 2023
@alexpensify
Copy link
Contributor

@cead22 - any update on the proposal review? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Sep 15, 2023
@cead22
Copy link
Contributor

cead22 commented Sep 22, 2023

Review submitted. Requested a couple of small changes

@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2023
@alexpensify
Copy link
Contributor

@ShogunFire have you been able to review the changes that Carlos suggested?

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2023
@ShogunFire
Copy link
Contributor

@alexpensify I just made the changes

@alexpensify
Copy link
Contributor

Thank you for the update!

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

@cead22 @alexpensify @ShogunFire @robertKozik this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@alexpensify alexpensify added the Reviewing Has a PR in review label Sep 28, 2023
@alexpensify
Copy link
Contributor

Easy melvin, there is a PR in review here. I've added the Reviewing label to clarify the state of this one.

@alexpensify
Copy link
Contributor

Looks like the PR was merged so waiting for the automation here.

@alexpensify alexpensify added Weekly KSv2 and removed Daily KSv2 labels Oct 6, 2023
@alexpensify
Copy link
Contributor

Looks like the PR was merged last week, I need to figure out if automation failed here and identify the new payment date. 🤔

@alexpensify
Copy link
Contributor

@cead22 and @robertKozik -- can you share an update on the status of this GH? I'm trying to figure out if the automation broke here or if we are waiting on another PR. Thanks!

@cead22
Copy link
Contributor

cead22 commented Oct 13, 2023

This is done, but the PR was on expensify-common, not App, which is probably why the automation failed. There should be an App PR to bump the version of expensify-common, but I bet we've already updated it to a version that includes the fix made in expensify-common for this

@alexpensify
Copy link
Contributor

@ShogunFire and @robertKozik - was there an App PR here? I don't see it and trying to make sure we pay everyone since there has been no regression. Thanks!

@ShogunFire
Copy link
Contributor

@alexpensify No, I haven't done an App PR, I am not sure what I am supposed to do. @cead22 seems to say it might already be done

@cead22
Copy link
Contributor

cead22 commented Oct 23, 2023

Yes this is done. The expensify-common PR was merged in Sep and the expensify-common commit that App is pointing to is from Oct

@robertKozik
Copy link
Contributor

robertKozik commented Oct 23, 2023

The last bump of the expensify-common is from last week, where PR from this issue was merged about a month.

edit: ⬆️ confirming

@alexpensify
Copy link
Contributor

@robertKozik any update on what action is needed here?

@robertKozik
Copy link
Contributor

As @cead22 comment, the PR is already live on staging/production. The PR for expensify-common has been merged in Sep. We didn't create the PR for updating the expenfisy-common version, but It has been done by somebody else in the meantime (lates update is from the last week, so it for sure contains our fix as well). As there is no trace of any regression I think we can proceed with this issue like the normal one which didn't cause any problems

@cead22
Copy link
Contributor

cead22 commented Oct 27, 2023

@alexpensify do you know what comes next or how to trigger the automation for the payments?

@alexpensify
Copy link
Contributor

I'm OOO today. On Monday I will review the GH for the payment summary (ex. is there is an urgency bonus) and start the process in Upwork manually.

@alexpensify
Copy link
Contributor

alexpensify commented Nov 1, 2023

Here is the payment summary:

  • External issue reporter @ShogunFire $50
  • Contributor that fixed the issue @ShogunFire $500
  • Contributor+ that helped on the issue and/or PR - @robertKozik payment outside of Upwork

Upwork Job:

*If applicable, the bonuses will be applied on the final payment

Extra Notes regarding payment: There is no urgency bonus but no penalties either.

@ShogunFire and @robertKozik -- please 👍🏼 if you agree and I'll work on the next steps. Thanks!

@alexpensify alexpensify reopened this Nov 1, 2023
@alexpensify
Copy link
Contributor

@ShogunFire - I sent over two Upwork contracts and need your approval to continue the process. Thanks!

@alexpensify
Copy link
Contributor

Closing - I've completed the payment process in Upwork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants