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-07-14] [$1000] mWeb- Link is not working for Viewing all receipts/Viewing all bills option #21189

Closed
1 of 6 tasks
kbecciv opened this issue Jun 21, 2023 · 29 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

@kbecciv
Copy link

kbecciv commented Jun 21, 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 app
  2. Go to settings > Workspace >Reimbursements
  3. Click to View All receipts

Expected Result:

Link is working for Viewing all receipts option

Actual Result:

Link is not working for Viewing all receipts option

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.27-6

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

IMG_1130.1.1.MP4
IMG_1131.MP4
RPReplay_Final1687270989.MP4

Expensify/Expensify Issue URL:

Issue reported by: @narzullome

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686726774076549

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c9e23c776186a8a6
  • Upwork Job ID: 1672142727528816640
  • Last Price Increase: 2023-06-23
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 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

@bernhardoj
Copy link
Contributor

Proposal

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

Can't open View all receipts in Safari, both web and mWeb.

What is the root cause of that problem?

Currently, we open the link inside a promise that waits for the API to complete.

API.makeRequestWithSideEffects('OpenOldDotLink', {}, {})
.then((response) => {
buildOldDotURL(url, response.shortLivedAuthToken).then((oldDotUrl) => {
Linking.openURL(oldDotUrl);
});
})
.catch(() => {
buildOldDotURL(url).then((oldDotUrl) => {
Linking.openURL(oldDotUrl);
});
});

However, in Safari, we can't open a link inside an async function. Here is a similar past issue #3615 and the solution is this PR #3764 that introduces asyncOpenUrl that implements a workaround for Safari. (actually, from my testing, it can work inside async if there is only a little delay, for example using a setTimeout with 0 delay)

asyncOpenUrl accepts a promise and a URL. The URL will be opened after the promise is done.

export default function asyncOpenURL(promise, url, shouldSkipCustomSafariLogic) {
if (!url) {
return;
}
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
if (!isSafari || shouldSkipCustomSafariLogic) {
promise.then((params) => {
Linking.openURL(typeof url === 'string' ? url : url(params));
});
} else {
const windowRef = window.open();
promise
.then((params) => {
windowRef.location = typeof url === 'string' ? url : url(params);
})
.catch(() => windowRef.close());
}
}

URL can be either a string or a function. The very first implementation of asyncOpenUrl only accepts the URL as a string, but then it allows a function in this PR.

It previously works until this commit that replaced asyncOpenUrl.

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

Use asyncOpenUrl back again. As the URL is available from the promise, we will pass the whole promise and a function for url. It will look like this:

asyncOpenURL(
    API.makeRequestWithSideEffects('OpenOldDotLink', {}, {})
        .then((response) => buildOldDotURL(url, response.shortLivedAuthToken))
        .catch(() => buildOldDotURL(url)),
    (url) => url,
);

@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Jun 23, 2023
@melvin-bot melvin-bot bot changed the title mWeb- Link is not working for Viewing all receipts/Viewing all bills option [$1000] mWeb- Link is not working for Viewing all receipts/Viewing all bills option Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

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

melvin-bot bot commented Jun 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Jun 23, 2023
@bfitzexpensify
Copy link
Contributor

@parasharrajat proposal from @bernhardoj ready for review when you get a chance - thanks!

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@parasharrajat
Copy link
Member

@bernhardoj's proposal looks good to me. Good catch.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jun 27, 2023

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

@cead22
Copy link
Contributor

cead22 commented Jun 29, 2023

Nice catch, sounds like this is a regression right?

The approach looks good to me, but we probably need to do something different in the failure case than .catch(() => buildOldDotURL(url)), because in that case we're gonna end up opening a link that doesn't work. In the commit you linked we do Growl.show(response.message, CONST.GROWL.WARNING); if the request fails, where I believe the message comes from the exception we throw in the backend and says "Cannot redirect to Expensify.com at the moment, please try again"

@bernhardoj
Copy link
Contributor

sounds like this is a regression right?

Yes

we do Growl.show

I think we want to remove all Growls. I also think redirecting the user without shortLivedAuthToken is fine. It just won't auto logging-in the user (if the user is signed out).

@cead22
Copy link
Contributor

cead22 commented Jun 29, 2023

As long as they land on the right page after signing in, I think that's good!

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

melvin-bot bot commented Jun 29, 2023

📣 @parasharrajat You have been assigned to this job!
Please apply to this job in Upwork here and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

📣 @bernhardoj You have been assigned to this job!
Please apply to this job in Upwork here and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

📣 @narzullome You have been assigned to this job!
Please apply to this job in Upwork here and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jun 30, 2023
@bernhardoj
Copy link
Contributor

PR is ready.

cc: @parasharrajat

@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

🎯 ⚡️ Woah @parasharrajat / @bernhardoj, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @bernhardoj got assigned: 2023-06-29 20:28:08 Z
  • when the PR got merged: 2023-07-03 23:05:54 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 7, 2023
@melvin-bot melvin-bot bot changed the title [$1000] mWeb- Link is not working for Viewing all receipts/Viewing all bills option [HOLD for payment 2023-07-14] [$1000] mWeb- Link is not working for Viewing all receipts/Viewing all bills option Jul 7, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 7, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.37-7 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-07-14. 🎊

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

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
Copy link

melvin-bot bot commented Jul 7, 2023

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:

  • [@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:
  • [@parasharrajat] 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:
  • [@parasharrajat] 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:
  • [@parasharrajat] Determine if we should create a regression test for this bug.
  • [@parasharrajat] 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.
  • [@bfitzexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jul 13, 2023
@bfitzexpensify
Copy link
Contributor

Offers have been sent out

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2023
@narzullome
Copy link

@bfitzexpensify Accepted thank you

@parasharrajat
Copy link
Member

parasharrajat commented Jul 17, 2023

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:

Regression Test Steps

  1. Open Settings > Workspaces > Select any workspace > Reimbursements.
  2. Press View all receipts
  3. Verify you are redirected to the OldDot web

Do you agree 👍 or 👎 ?

@bfitzexpensify
Copy link
Contributor

I like those @parasharrajat. Proposed they be added in https://github.com/Expensify/Expensify/issues/300649. Cool, we're all done here - thanks everyone!

@parasharrajat
Copy link
Member

Payment requested 1500.

@JmillsExpensify
Copy link

@bfitzexpensify Can you please summarize the appropriate individual payments for all parties involved in this issue? This is holding up @eVoloshchak's and @parasharrajat's NewDot payments. More information on this compliance process in Slack.

@parasharrajat
Copy link
Member

Bump @bfitzexpensify. Can you please update the above-requested info?

@bfitzexpensify
Copy link
Contributor

Sorry, was OOO on Friday.

Payments for each party:

Reporting: $250 for @narzullome, paid via Upwork ✅
Contributor: $1,500 (completion + #urgency bonus) for @bernhardoj, paid via Upwork ✅
C+: $1,500 (completion + #urgency bonus) for @parasharrajat, which will need to be paid via NewDot

@JmillsExpensify
Copy link

Reviewed details for @parasharrajat. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

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

7 participants