Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.03k stars 2.54k forks source link

[HOLD for Payment 2023-09-20][$2000] Can't parse deep link with email param. #16762

Closed kavimuru closed 8 months ago

kavimuru commented 1 year ago

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. Try to open user detail from deep link on browser (for example: https://staging.new.expensify.com/details?login=testing@gmail.com).
  2. Now go to any report, paste that link and click send.
  3. Notice that it can't parse the whole link, and when user try to click on it, it opens the email app with the wrong email filled.

Expected Result:

App should parse the deep link detail with email param.

Actual Result:

App can't parse the deep link detail with email param. The URL prefix (https://) is not part of the link, and we instead link incorrectly.

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?

Version Number: 1.2.92-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

https://user-images.githubusercontent.com/43996225/228922658-ef1627e6-9f3e-4f91-a52a-8cb26a5ea47f.mov

Untitled

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013659e025d6ce0e4f
  • Upwork Job ID: 1644482548992663552
  • Last Price Increase: 2023-06-26
  • Automatic offers:
    • 0xmiroslav | Reviewer | 26524537
    • Antasel | Contributor | 26524539
    • hungvu193 | Reporter | 26524541
MelvinBot commented 1 year ago

Current assignee @0xmiroslav is eligible for the Internal assigner, not assigning anyone new.

johnmlee101 commented 1 year ago

I think we're close to a solution, @0xmiroslav what do you think of the latest updated proposals?

sakluger commented 1 year ago

@johnmlee101 do you think we're close enough to switch back to external?

0xmiroslav commented 1 year ago

I reviewed recent 2 proposals after last review. Still doesn't work for some cases. @tienifr @akinwale please run automated tests (npm run test) in expensify-common repo. You will easily find regression cases. Please submit updated proposal only when tests pass.

0xmiroslav commented 1 year ago

@sakluger as this is really not an easy issue, we can bump the price so that contributors investigate more time to avoid any regressions. or @johnmlee101 will work on this internally?

akinwale commented 1 year ago

I reviewed recent 2 proposals after last review. Still doesn't work for some cases. @tienifr @akinwale please run automated tests (npm run test) in expensify-common repo. You will easily find regression cases. Please submit updated proposal only when tests pass.

@0xmiroslav Thanks for the update. I was initially looking for these tests, so that I could run them, as I was testing directly in the browser. I have updated the regex in my proposal (also please note it still goes with the replacement method), and all test cases pass now. I also like the idea of bumping the price. ๐Ÿ˜…

Here are the results.

16762-npm-run-test

Demo video

16762-final-demo.webm

ahmedGaber93 commented 1 year ago

I update my proposal, and it works fine and pass all test. But I recently find negative look behind (?<!) supported in ECMAScript 9(2018) while we use ES6 as I know (I think this can help others to stop using it, unless we decide to use it)

ahmedGaber93 commented 1 year ago

Proposal

Updated

edit REGEXP of autoEmail to be match optional http\\S*= and use it in replacement case like this.

{
    name: 'autoEmail',
    regex: new RegExp(
        `(?![^<]*>|[^<>]*<\\/)((?:http\\S*=)?)${CONST.REG_EXP.MARKDOWN_EMAIL}(?![^<]*(<\\/pre>|<\\/code>|<\\/a>))`,
        'gim',
    ),
    replacement: (match, g1, g2) => {
        return g1 ? match : `<a href="mailto:${g2}">${g2}</a>`;
    },
},
test text ``` https://www.expensify.com?name=test&email=testing@gmail.com https://www.expensify.com?name=test&email= testing@gmail.com test@expensify.com https://www.expensify.com bruh test@expensify.com https://www.expensify.com https://www.expensify.com test@expensify.com https://staging.new.expensify.com/details?login= testing@gmail.com bacon antoher@gmail.com multiple spaces https://www.expensify.com test@expensify.com [test ]](test@expensify.com) another scenario [test@expensify.com] checking boundaries \test@expensify.com https://staging.new.expensify.com/details?name=test&email= testing@gmail.com final@expensify.com last check testing@gmail.com google.com@gmail.com tests fine https://www.expensify.com?name=test&email=testing@gmail.com random@gmail.com https://www.expensify.com?name=test&email=testing@gmail.com random2@gmail.com ```

all test passed in expensify-common by npm run test

result

https://user-images.githubusercontent.com/41129870/235198883-c1843f0b-8f7a-4fca-9f52-be6b3b27d6fd.mov

johnmlee101 commented 1 year ago

Yeah I think I'm fine with bumping the price, it's a fairly complex, and the discussions have been active so I don't think we'll move this to internal just yet

MelvinBot commented 1 year ago

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

MelvinBot commented 1 year ago

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

MelvinBot commented 1 year ago

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

MelvinBot commented 1 year ago

Upwork job price has been updated to $2000

sakluger commented 1 year ago

@sakluger as this is really not an easy issue, we can bump the price so that contributors investigate more time to avoid any regressions. or @johnmlee101 will work on this internally?

I agree, I've raised to $2000.

sakluger commented 1 year ago

@0xmiroslav any thoughts on the latest proposals?

hoangzinh commented 1 year ago

Proposal

Updated https://github.com/Expensify/App/issues/16762#issuecomment-1500804673

I have updated my proposal to fix cases that @0xmiroslav pointed out https://github.com/Expensify/App/issues/16762#issuecomment-1522954837

tienifr commented 1 year ago

I reviewed recent 2 proposals after last review. Still doesn't work for some cases. @tienifr @akinwale please run automated tests (npm run test) in expensify-common repo. You will easily find regression cases. Please submit updated proposal only when tests pass.

@0xmiroslav the tests failed due to new changes to the URL_WEBSITE_REGEX that causes the example regex I provided to be incorrect, not due to the solution itself.

Proposal updated to address that, all tests passing now.

Screenshot 2023-05-02 at 21 15 28

Thanks!

sakluger commented 1 year ago

@0xmiroslav could you please review the lastest proposals?

melvin-bot[bot] commented 1 year ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

0xmiroslav commented 1 year ago

updating today

0xmiroslav commented 1 year ago

Sorry for delay here, been busy on urgent PRs for EC3. I will provide feedback asap on latest proposals after last review

sakluger commented 1 year ago

All good, thanks for the context. That's fine since EC3 issues take priority right now.

sakluger commented 1 year ago

EC3 is still top priority.

melvin-bot[bot] commented 1 year ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

johnmlee101 commented 1 year ago

It's been a week. Checking in! Are you still reviewing proposals?

0xmiroslav commented 1 year ago

Still evaluating proposals. I will provide update tomorrow.

sakluger commented 1 year ago

EC3 is happening! And deploys are paused for the rest of the week. @0xmiroslav hopefully that means there will be some time to review these proposals.

sakluger commented 1 year ago

Hey @0xmiroslav, can you please prioritize reviewing these proposals? The latest proposal updates have been waiting 3 weeks, so we need to start moving this forward.

0xmiroslav commented 1 year ago

Sure, planning to post updates tomorrow

melvin-bot[bot] commented 1 year ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

johnmlee101 commented 1 year ago

Bump! @0xmiroslav

0xmiroslav commented 1 year ago

@akinwale your solution failing test cases. please update proposal based on latest codebase. To confirm this is your regex, right?

(?![^<]*>|[^<>]*<\\/)(^| |\\b)${CONST.REG_EXP.MARKDOWN_EMAIL}(?![^<]*(<\\/pre>|<\\/code>|<\\/a>))
akinwale commented 1 year ago

@akinwale your solution failing test cases. please update proposal based on latest codebase. To confirm this is your regex, right?

(?![^<]*>|[^<>]*<\\/)(^| |\\b)${CONST.REG_EXP.MARKDOWN_EMAIL}(?![^<]*(<\\/pre>|<\\/code>|<\\/a>))

No.

Please check my proposal for my most up to date regex and replacement. It was updated over a month ago. Thanks.

sakluger commented 1 year ago

Bump @0xmiroslav. I noticed that you have a lot of issues assigned currently - let me know if you'd like me to reassign, it's no problem.

melvin-bot[bot] commented 1 year ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

0xmiroslav commented 1 year ago

@akinwale your latest proposal is still failing my test cases.

I am currently adding more edge cases in automated tests myself locally to validate all proposals in an automatic way.

tienifr commented 1 year ago

@0xmiroslav hi, just checking what do you think of my proposal here https://github.com/Expensify/App/issues/16762#issuecomment-1531561529? It passes all test cases.

Thanks!

hoangzinh commented 1 year ago

@tienifr He's adding more test cases in his end and validate all our proposals. So just wait @0xmiroslav

0xmiroslav commented 1 year ago

expecting update tomorrow

melvin-bot[bot] commented 1 year ago

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

sakluger commented 1 year ago

Readded BZ label since I'm OOO next week.

0xmiroslav commented 12 months ago

still testing proposed solutions one by one

flaviadefaria commented 12 months ago

@0xmiroslav do you think you can this assigned to a contributor by tomorrow?

melvin-bot[bot] commented 12 months ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

flaviadefaria commented 12 months ago

@0xmiroslav can you give an update?

0xmiroslav commented 12 months ago

Sorry I will update tomorrow

0xmiroslav commented 11 months ago

updating very soon

melvin-bot[bot] commented 11 months ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

flaviadefaria commented 11 months ago

@0xmiroslav it's been more than 10 days here without hearing from you. What's going on? Also @sakluger as you're back I'm returning this to you.

0xmiroslav commented 11 months ago

Apologize for extreme delays on this issue. was focusing on more priority issues meanwhile. Update: added most automated cases myself locally and still fixing expected strings. I will give final update on Monday.