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 2024-08-02] [$250] Web - "Something went wrong" when trying to submit an expense that has an attached receipt #45967

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 22, 2024 · 30 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

@lanitochka17
Copy link

lanitochka17 commented Jul 22, 2024

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: 9.0.10-6
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go offline
  2. Go to the SelfDM
  3. Create a track-expense
  4. Click on track-expense preview to open the combine report
  5. Click on the SelfDM in LHN (important step)
  6. Submit this to someone
  7. Go online

Expected Result:

The app does not crash

Actual Result:

Notice that the app crashes after a few second

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

Bug6549951_1721682212879.A-42971.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017b5e835a2e35369b
  • Upwork Job ID: 1815647774820428635
  • Last Price Increase: 2024-07-23
  • Automatic offers:
    • nkdengineer | Contributor | 103228117
Issue OwnerCurrent Issue Owner: @fedirjh
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

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

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.

@francoisl
Copy link
Contributor

I can't reproduce on version v9.0.10-7, though after submitting the expense to someone, it gets put on Hold with a red brick road.

@mountiny mountiny added External Added to denote the issue can be worked on by a contributor Daily KSv2 Needs Reproduction Reproducible steps needed and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 DeployBlocker Indicates it should block deploying the API labels Jul 23, 2024
@melvin-bot melvin-bot bot changed the title Web - "Something went wrong" when trying to submit an expense that has an attached receipt [$250] Web - "Something went wrong" when trying to submit an expense that has an attached receipt Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

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

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

melvin-bot bot commented Jul 23, 2024

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

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@mountiny
Copy link
Contributor

I could not repro either, demoting:

Screen.Recording.2024-07-23.at.09.18.01.mp4

@nkdengineer
Copy link
Contributor

Proposal

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

"Something went wrong" when trying to submit a manual expense after attaching a receipt to it

What is the root cause of that problem?

When we create a track-expense, the policyID of the combine report is _FAKE_. When we submit this to someone, it is changed to the personal policyID of the user.

The problem is the policyID of the iou report is changed from _FAKE_ to personal policyID after we submit the track expense to someone. Then the app crashes because the key is changed from collection key to member collection key.

const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID ?? '-1'}`);

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

We should check if the report.policyID is _FAKE_, we will fallback it to -1

const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? -1 : report.policyID ?? '-1'}`);

const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID ?? '-1'}`);

What alternative solutions did you explore? (Optional)

@nkdengineer
Copy link
Contributor

@mountiny I can reproduce this bug.

Here are the steps to reproduce:

  1. Go offline
  2. Go to the SelfDM
  3. Create a track-expense
  4. Click on track-expense preview to open the combine report
  5. Click on the SelfDM in LHN (important step)
  6. Submit this to someone
  7. Go online and notice that the app crashes after a few second

@mountiny
Copy link
Contributor

Thanks @nkdengineer your proposal makes sense to me, I will assign you now

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 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 📖

@nkdengineer
Copy link
Contributor

Will raise the PR soon.

@mountiny
Copy link
Contributor

I have updated the OP with the description from @nkdengineer

@rafaykr

This comment was marked as off-topic.

This comment was marked as outdated.

@rafaykr
Copy link

rafaykr commented Jul 23, 2024

contributor details
expensify account email:kamham56@gmail.com
upwork account : https://www.upwork.com/freelancers/~01510f6bfd2680dd92

@rafaykr

This comment was marked as off-topic.

@Beamanator
Copy link
Contributor

@rafaykr please review our community's Contributing documentation before continuing to post here :D

@mariapeever
Copy link

Proposal

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

"Something went wrong" when trying to submit an expense that has an attached receipt #45967

What is the root cause of that problem?

The policy ID of fake users is set to "_FAKE_" on registration as part of onboarding, which is not in the correct format for processing on tracking an expense. The constants for ID_FAKE and OWNER_EMAIL_FAKE are not in the correct format too - "_FAKE_" instead of "FAKE_".

policyID: reportOnyx?.policyID,

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

The report policy ID should be set to "FAKE_" instead of "_FAKE_" on fake user registration/onboarding as well as the values for constants ID_FAKE and OWNER_EMAIL_FAKE. This resolves the issue for new fake users. All records of existing fake users require a migration to update their policy ids. The migration should rename existing policy ID values currently set to "_FAKE_" to "FAKE_" in the REPORT collection (e.g. in /src/libs/migrations/RenameReportPolicyID.ts).

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 23, 2024
@Beamanator
Copy link
Contributor

@mariapeever thanks so much for your proposal, but we already hired someone for this job about 10 hours ago.

I'd recommend looking for the Help Wanted label -> You can see that isn't not on this issue anymore, and that's because we already hired someone

Copy link

melvin-bot bot commented Jul 25, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@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 26, 2024
@melvin-bot melvin-bot bot changed the title [$250] Web - "Something went wrong" when trying to submit an expense that has an attached receipt [HOLD for payment 2024-08-02] [$250] Web - "Something went wrong" when trying to submit an expense that has an attached receipt Jul 26, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 26, 2024
Copy link

melvin-bot bot commented Jul 26, 2024

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

Copy link

melvin-bot bot commented Jul 26, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.12-0 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 2024-08-02. 🎊

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Aug 1, 2024
@Beamanator Beamanator added the Bug Something is broken. Auto assigns a BugZero manager. label Aug 2, 2024
@Beamanator
Copy link
Contributor

oh hey we need a bugzero person for payment here 😅

Copy link

melvin-bot bot commented Aug 2, 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 removed the Overdue label Aug 2, 2024
@Beamanator
Copy link
Contributor

@slafortune please help with payment here, I forgot to add the Bug label earlier :D

@slafortune
Copy link
Contributor

slafortune commented Aug 2, 2024

@fedirjh Role C+ - requires payment through NewDot Manual Requests $250
@nkdengineer Role contributor - requires payment automatic offer (Contributor) $250 - Paid ✔️

@JmillsExpensify
Copy link

$250 approved for @fedirjh

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