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

[$250] Track Expense - Website crashes when submitting a track expense. #54605

Open
3 of 8 tasks
IuliiaHerets opened this issue Dec 27, 2024 · 20 comments
Open
3 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 27, 2024

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.79-0
Reproducible in staging?: Yes
Reproducible in production?: No
Email or phone of affected tester (no customers): ibellicotest [email protected]
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome
App Component: Chat Report View

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Open Self DM.
  3. Tap on " " button and select "Create Expense"
  4. Complete the expense creation flow.

Expected Result:

After creating a track expense, the user should land on self DM again and the expense details should be visible on the chat.

Actual Result:

Website crashes after submitting a track expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6702794_1735282391342!log.txt

Bug6702794_1735281424305.Track_Crash.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021872615001903986307
  • Upwork Job ID: 1872615001903986307
  • Last Price Increase: 2024-12-27
  • Automatic offers:
    • brunovjk | Contributor | 105477339
    • nkdengineer | Contributor | 105477345
Issue OwnerCurrent Issue Owner: @brunovjk
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Dec 27, 2024
Copy link

melvin-bot bot commented Dec 27, 2024

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

Copy link

melvin-bot bot commented Dec 27, 2024

Triggered auto assignment to @slafortune (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 Dec 27, 2024
Copy link

melvin-bot bot commented Dec 27, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 27, 2024
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.

@nkdengineer
Copy link
Contributor

Proposal

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

Website crashes after submitting a track expense.

What is the root cause of that problem?

We removed the fallback here then the app crashes when the chatReportID is changed from an empty string to an exist ID.

const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`);

chatReportID={ReportActionsUtils.getOriginalMessage(action)?.IOUReportID ? report?.chatReportID ?? '' : reportID}

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

Bring the fallback ID back

const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`);

Or when we create the track expense we should set IOUReportID of the IOU action as 0 in optimistic data since BE also returns like this.

chatReportID={ReportActionsUtils.getOriginalMessage(action)?.IOUReportID ? report?.chatReportID ?? '' : reportID}

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

What alternative solutions did you explore? (Optional)

NA

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.

@nkuoch
Copy link
Contributor

nkuoch commented Dec 27, 2024

@brunovjk can you review this above proposal?

@brunovjk
Copy link
Contributor

Sure!

@brunovjk
Copy link
Contributor

@nkdengineer Your proposal makes sense to me. I’ve brought back the fallback ID using CONST.DEFAULT_NUMBER_ID here, and it resolves this specific issue.

However, in the original PR, we made changes in other locations to align with the new 'default-value-for-inexistent-ids' rule. I’m concerned these changes might have unintentionally impacted other flows, that I may not have considered, potentially leading to regressions like this one. Do you see other lines with useOnyx or related logic where we should reintroduce CONST.DEFAULT_NUMBER_ID in the MoneyRequestPreviewContent.tsx? Thank you

@nkdengineer
Copy link
Contributor

Do you see other lines with useOnyx or related logic where we should reintroduce CONST.DEFAULT_NUMBER_ID in the MoneyRequestPreviewContent.tsx? Thank you

Bring the fallback ID back

@brunovjk The crash app will happen for the collect onyx keys then when I mentioned Bring the fallback ID that mean we need to update this for all useOnyx that connects with collection keys in MoneyRequestPreviewContent.

@nkdengineer
Copy link
Contributor

chatReportID={ReportActionsUtils.getOriginalMessage(action)?.IOUReportID ? report?.chatReportID ?? '' : reportID}

Or we should fallback here to -1 instead of empty string.

@brunovjk
Copy link
Contributor

Great! Thanks @nkdengineer, I think we can go with their proposal.

🎀👀🎀 C reviewed

Copy link

melvin-bot bot commented Dec 27, 2024

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

@brunovjk
Copy link
Contributor

oops, I added 🎀 out of habit

@nkuoch nkuoch added the External Added to denote the issue can be worked on by a contributor label Dec 27, 2024
@melvin-bot melvin-bot bot changed the title Track Expense - Website crashes when submitting a track expense. [$250] Track Expense - Website crashes when submitting a track expense. Dec 27, 2024
Copy link

melvin-bot bot commented Dec 27, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 27, 2024
Copy link

melvin-bot bot commented Dec 27, 2024

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

@nkuoch nkuoch assigned brunovjk and unassigned hungvu193 Dec 27, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 27, 2024
Copy link

melvin-bot bot commented Dec 27, 2024

📣 @brunovjk 🎉 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 📖

@nkuoch nkuoch assigned nkdengineer and unassigned nkdengineer Dec 27, 2024
Copy link

melvin-bot bot commented Dec 27, 2024

📣 @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 Dec 27, 2024
@nkdengineer
Copy link
Contributor

@brunovjk The PR is ready for review.

@brunovjk
Copy link
Contributor

Great! Reviewing now.

@jasperhuangg
Copy link
Contributor

Tests well! Thanks for the fix

@jasperhuangg jasperhuangg removed the DeployBlockerCash This issue or pull request should block deployment label Dec 27, 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. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants