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

[Due for payment 2025-02-25] [$250] Hybrid - Android - Expense - App crashes when submitting a distance track expense to a workspace. #56906

Closed
1 of 8 tasks
IuliiaHerets opened this issue Feb 15, 2025 · 24 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Feb 15, 2025

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: 9.0.98-7
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: #55459
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12
App Component: Money Requests

Action Performed:

  1. Open the Expensify app.
  2. Tap on "Reports" on the bottom of the screen.
  3. Tap on the FAB and select "Create Expense"
  4. Tap on "Distance" and add valid waypoints.
  5. Tap on "Next"
  6. Tap on the expense destination and choose Self DM.
  7. Once redirected to "Reports" again, wait for the expense to appear on the list.
  8. Navigate to Self DM.
  9. On the options on the created expense, select "Share it with my accountant" and select any workspace.
  10. Change the distance rate and submit the expense.
  11. Check the app´s behaviour after this action.

Expected Result:

User should be able to submit a distance track expense to any workspace without any issue.

Actual Result:

The app crashes after creating a distance track expense and submitting it to a workspace using the "Share with my accountant" option.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6744333_1739650879233!log.txt
https://github.com/user-attachments/assets/0898e0a7-d15d-4f2f-ba2c-bbe088465fce

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021891254669429387722
  • Upwork Job ID: 1891254669429387722
  • Last Price Increase: 2025-02-16
  • Automatic offers:
    • nkdengineer | Contributor | 106152809
Issue OwnerCurrent Issue Owner: @laurenreidexpensify
@IuliiaHerets IuliiaHerets added Bug Something is broken. Auto assigns a BugZero manager. DeployBlockerCash This issue or pull request should block deployment labels Feb 15, 2025
Copy link

melvin-bot bot commented Feb 15, 2025

Triggered auto assignment to @srikarparsi (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Feb 15, 2025

Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added the Daily KSv2 label Feb 15, 2025
Copy link

melvin-bot bot commented Feb 15, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Feb 15, 2025
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@IuliiaHerets
Copy link
Author

Production has another behavior

screen-20250215-223708.mp4

@nkdengineer
Copy link
Contributor

Proposal

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

The app crashes after creating a distance track expense and submitting it to a workspace using the "Share with my accountant" option.

What is the root cause of that problem?

When we submit a distance track expense to a workspace, the optimistic receipt has source is ReceiptGeneric and the type is the number

const trackedReceipt = validWaypoints ? {source: ReceiptGeneric as ReceiptSource, state: CONST.IOU.RECEIPT_STATE.OPEN} : receipt;

receipt: isFileUploadable(trackedReceipt) ? trackedReceipt : undefined,

Then the app crashes when we try to get the file name here

let source = transactionItem?.receipt?.source ?? '';
if (source) {
const filename = getFileName(source);

const fileName = url.split('/').pop()?.split('?')[0].split('#')[0] ?? '';

But why we can't reproduce this bug in production?

It comes from #49539. After the navigation refactors, when we go to Reports to Inbox, the SearchPage isn't unmounted so the app crashes immediately.

While in production, when we go to Reports to Inbox the search page is unmounted and if we go to the Reports again, the API updates the source to current distance receipt then the app doesn't crash

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

We should add a check here to not do this logic if the source isn't string type

if (source && typeof source === 'string') {
    const filename = getFileName(source);
    const receiptURIs = getThumbnailAndImageURIs(transactionItem, null, filename);
    const isReceiptPDF = Str.isPDF(filename);
    source = tryResolveUrlFromApiRoot(isReceiptPDF && !receiptURIs.isLocalFile ? receiptURIs.thumbnail ?? '' : receiptURIs.image ?? '');
}

let source = transactionItem?.receipt?.source ?? '';
if (source) {
const filename = getFileName(source);

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None

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.

@srikarparsi srikarparsi added the External Added to denote the issue can be worked on by a contributor label Feb 16, 2025
@melvin-bot melvin-bot bot changed the title Hybrid - Android - Expense - App crashes when submitting a distance track expense to a workspace. [$250] Hybrid - Android - Expense - App crashes when submitting a distance track expense to a workspace. Feb 16, 2025
Copy link

melvin-bot bot commented Feb 16, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 16, 2025
Copy link

melvin-bot bot commented Feb 16, 2025

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

@eh2077
Copy link
Contributor

eh2077 commented Feb 17, 2025

@nkdengineer I agree with your RCA. But I have concerns about your solution. If

let source = transactionItem?.receipt?.source ?? '';

is a number (static images), how should we handle the source? We can't pass number to

<ReceiptImage
source={source}

right?

@nkdengineer
Copy link
Contributor

@eh2077 This will not be a problem, the Image component still accepts the number source

@eh2077
Copy link
Contributor

eh2077 commented Feb 17, 2025

@nkdengineer 's proposal looks good to me!

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Feb 17, 2025

Current assignee @srikarparsi is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 17, 2025
Copy link

melvin-bot bot commented Feb 17, 2025

📣 @nkdengineer 🎉 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 added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Feb 17, 2025
@mountiny mountiny removed the DeployBlockerCash This issue or pull request should block deployment label Feb 17, 2025
@mountiny
Copy link
Contributor

Fixed in staging $250 to @nkdengineer $125 to @eh2077

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 18, 2025
@melvin-bot melvin-bot bot changed the title [$250] Hybrid - Android - Expense - App crashes when submitting a distance track expense to a workspace. [Due for payment 2025-02-25] [$250] Hybrid - Android - Expense - App crashes when submitting a distance track expense to a workspace. Feb 18, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 18, 2025
Copy link

melvin-bot bot commented Feb 18, 2025

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

Copy link

melvin-bot bot commented Feb 18, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.99-2 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 2025-02-25. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Feb 18, 2025

@eh2077 @laurenreidexpensify @eh2077 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 Overdue labels Feb 24, 2025
@laurenreidexpensify
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@laurenreidexpensify
Copy link
Contributor

@eh2077 please complete list above thanks

@laurenreidexpensify
Copy link
Contributor

Payment Summary:

C+ $250 @eh2077, please request in ND

@eh2077
Copy link
Contributor

eh2077 commented Feb 26, 2025

Fixed in staging $250 to @nkdengineer $125 to @eh2077

@laurenreidexpensify 👋, my payment should be $125. I'll complete checklist by today. Thank you

@nkdengineer
Copy link
Contributor

Fixed in staging $250 to @nkdengineer $125 to @eh2077

@laurenreidexpensify Based on this, I also should be paid here.

@eh2077
Copy link
Contributor

eh2077 commented Feb 26, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other: This bug was uncovered by a recent PR Implement flexible bottom tab bar #49539 which changes navigation

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: Implement flexible bottom tab bar #49539 (comment)

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: NA

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

  • NA

Test:

  1. Login with an account that has the selfDM
  2. Go to Reports
  3. Create a track distance with valid waypoint
  4. Go to the selfDM
  5. Select Share it with my accountant
  6. Select a workspace and complete the flow
  7. Verify that the app doesn't crashes

Do we agree 👍 or 👎

@laurenreidexpensify
Copy link
Contributor

Updated Payment Summary:

$250 Contributor @nkdengineer paid via Upwork
$125 C+ review @eh2077 please request in ND

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants