Skip to content

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

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com 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

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 9, 2023
  2. 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[/+] on Nov 9, 2023
  3. melvin-bot commented on Nov 9, 2023

    @melvin-bot

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

  4. melvin-bot commented on Nov 9, 2023

    @melvin-bot
  5. melvin-bot commented on Nov 9, 2023

    @melvin-bot

    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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 9, 2023
  7. melvin-bot commented on Nov 9, 2023

    @melvin-bot

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

  8. dukenv0307 commented on Nov 9, 2023

    @dukenv0307
    Contributor

    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.

  9. erquhart commented on Nov 9, 2023

    @erquhart
    Contributor

    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.

  10. s77rt commented on Nov 10, 2023

    @s77rt
    Member

    @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

  11. 35 remaining items

  12. dukenv0307 commented on Dec 4, 2023

    @dukenv0307
    Contributor

    @s77rt The PR is ready for review.

  13. melvin-bot commented on Dec 27, 2023

    @melvin-bot

    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!

  14. s77rt commented on Dec 27, 2023

    @s77rt
    Member

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

  15. dukenv0307 commented on Jan 31, 2024

    @dukenv0307
    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!

  16. s77rt commented on Feb 5, 2024

    @s77rt
    Member

    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)

  17. dukenv0307 commented on Mar 18, 2024

    @dukenv0307
    Contributor

    @strepanier03 could you kindly help with the payment here?

    @strepanier03 friendly bump on this!

  18. strepanier03 commented on Mar 20, 2024

    @strepanier03
    Contributor

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

  19. strepanier03 commented on Mar 20, 2024

    @strepanier03
    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.

  20. 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[/+] on Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions