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

[PAID] [$500] Distance - Receipt opens Not here page instead of e-receipt when Distance is created offline #31138

Closed
2 of 6 tasks
lanitochka17 opened this issue Nov 9, 2023 · 32 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 9, 2023

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


Version Number: 1.3.97-1
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

Precondition: Have at least two saved addresses.

  1. Launch New Expensify app.
  2. Go offline
  3. Go to workspace chat > + > Distance
  4. Create a distance request offline
  5. Go to distance request details page
  6. Click on the receipt

Expected Result:

Ereceipt is shown with pending map

Actual Result:

Not here page is displayed
On web, the receipt shows e-receipt with pending map when the request is created offline

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6270172_1699546185542.iOS.mp4
Bug6270172_1699546341273.Web.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019b7e5a74d81069f4
  • Upwork Job ID: 1722650432215658496
  • Last Price Increase: 2023-11-09
  • Automatic offers:
    • s77rt | Reviewer | 27899043
    • dukenv0307 | Contributor | 27899044
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 9, 2023
@melvin-bot melvin-bot bot changed the title Distance - Receipt opens Not here page instead of e-receipt when Distance is created offline [$500] Distance - Receipt opens Not here page instead of e-receipt when Distance is created offline Nov 9, 2023
Copy link

melvin-bot bot commented Nov 9, 2023

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

Copy link

melvin-bot bot commented Nov 9, 2023

Job added to Upwork: https://www.upwork.com/jobs/~019b7e5a74d81069f4

Copy link

melvin-bot bot commented Nov 9, 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 Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 9, 2023
Copy link

melvin-bot bot commented Nov 9, 2023

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 9, 2023

Proposal

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

Not here page is displayed

What is the root cause of that problem?

In here, we're comparing the source like this in order to get the initialPage, the problem is attachment.source is a number (it's native iOS's file representation), while source is a string (because when the push the report attachment page, we encodeURI on it and then decodeURI, it remains a string). So it's always false when compared, leading to the not found page showing.

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

We need to cast both (or only attachment.source) to string when comparing here

return String(attachment.source) === String(source);

What alternative solutions did you explore? (Optional)

When decoding the URI here, we can check if the source is number, if yes we cast to number.

let source = decodeURI(_.get(props, ['route', 'params', 'source']));
source = isNaN(source) ? source : parseInt(source, 10);

I actually prefer this a bit more because we ensure that the data is correct from the source, before we pass it by intermediary components.

@erquhart
Copy link
Contributor

erquhart commented Nov 9, 2023

Proposal

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

Attachment modal won't load when offline on a native app.

What is the root cause of that problem?

We're strictly comparing a number and a string to find the attachment index here:

return attachment.source === source;

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

Convert attachment.source to a string before comparing.

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@s77rt
Copy link
Contributor

s77rt commented Nov 10, 2023

@dukenv0307 Thanks for the proposal. Your RCA is correct. Fixing this at the highest level looks good here i.e. the alternative solution.

const decodedSource = decodeURI(_.get(props, ['route', 'params', 'source']));
const source = Number(decodedSource) || decodedSource;

If the source is a string of numbers then it's assumed we imported an image asset. In this case the source is supposed to be a number.

🎀 👀 🎀 C+ reviewed
Link to proposal

Copy link

melvin-bot bot commented Nov 10, 2023

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

@s77rt
Copy link
Contributor

s77rt commented Nov 10, 2023

@erquhart Thanks for the proposal but it seems to be a dupe.

@melvin-bot melvin-bot bot added the Overdue label Nov 13, 2023
@s77rt
Copy link
Contributor

s77rt commented Nov 13, 2023

Not overdue. @joelbettner #31138 (comment)

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 13, 2023
Copy link

melvin-bot bot commented Nov 20, 2023

@strepanier03, @joelbettner, @s77rt Still overdue 6 days?! Let's take care of this!

@s77rt
Copy link
Contributor

s77rt commented Nov 20, 2023

@joelbettner ^

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2023
Copy link

melvin-bot bot commented Nov 23, 2023

@strepanier03 @joelbettner @s77rt this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Nov 23, 2023
@s77rt
Copy link
Contributor

s77rt commented Nov 23, 2023

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 23, 2023
@s77rt
Copy link
Contributor

s77rt commented Nov 27, 2023

@joelbettner ^

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

melvin-bot bot commented Nov 30, 2023

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

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 30, 2023

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

Offer link
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 melvin-bot bot removed the Overdue label Nov 30, 2023
@joelbettner
Copy link
Contributor

Proposal looks good. I assigend @dukenv0307.

Sorry for the delay. I was OOO and been catching up on things since I was out.

Copy link

melvin-bot bot commented Nov 30, 2023

@strepanier03 @joelbettner @s77rt @dukenv0307 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!

1 similar comment
Copy link

melvin-bot bot commented Nov 30, 2023

@strepanier03 @joelbettner @s77rt @dukenv0307 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!

@s77rt
Copy link
Contributor

s77rt commented Dec 1, 2023

We have a selected proposal, Melvin

@melvin-bot melvin-bot bot added the Overdue label Dec 4, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 labels Dec 4, 2023
@dukenv0307
Copy link
Contributor

@s77rt The PR is ready for review.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Dec 27, 2023
Copy link

melvin-bot bot commented Dec 27, 2023

This issue has not been updated in over 15 days. @strepanier03, @joelbettner, @s77rt, @dukenv0307 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@s77rt
Copy link
Contributor

s77rt commented Dec 27, 2023

PR was deployed to production 3 weeks ago. Seems like the auto process failed here.

@dukenv0307
Copy link
Contributor

PR was deployed to production 3 weeks ago. Seems like the auto process failed here.

@strepanier03 could you kindly help with the payment here?

Thank you!

@s77rt
Copy link
Contributor

s77rt commented Feb 5, 2024


Regression Test Proposal

  1. Go offline
  2. Create a distance request
  3. Go to the transaction report of that request
  4. Click on the receipt image
  5. Verify that receipt image loads correctly

(Related https://expensify.testrail.io/index.php?/cases/view/2661872 and https://expensify.testrail.io/index.php?/cases/view/2730072)

@dukenv0307
Copy link
Contributor

@strepanier03 could you kindly help with the payment here?

@strepanier03 friendly bump on this!

@strepanier03 strepanier03 added Daily KSv2 and removed Monthly KSv2 labels Mar 20, 2024
@strepanier03
Copy link
Contributor

Sorry about this, it was still set to Monthly and went under the radar.

@strepanier03
Copy link
Contributor

Thank you both so much for your patience and I'm sorry about the delay here. If you ever notice automation failing and the GH is staying in Monthly or Weekly, you can ping me in Slack right away and I'll switch the label. Frankly, there's just too many GHs every day to be able to check through Weeklies, let alone Monthlies, so I am relying heavily on automation to float things up that need my attention.

I've paid you both and created the reg test GH as well. Going to close this out.

@strepanier03 strepanier03 changed the title [$500] Distance - Receipt opens Not here page instead of e-receipt when Distance is created offline [PAID] [$500] Distance - Receipt opens Not here page instead of e-receipt when Distance is created offline Mar 20, 2024
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. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants