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-12-03] [Search v1.2] Android - Expense - Unexpected error when submitting expense to same WS after paying another #52368

Closed
4 of 8 tasks
IuliiaHerets opened this issue Nov 12, 2024 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 12, 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.60-0
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5204723&group_by=cases:section_id&group_order=asc&group_id=319502
Issue reported by: Applause Internal Team

Action Performed:

  1. Open the Expensify app.
  2. Tap on the FAB and select "Submit Expense"
  3. Complete the expense creation process and send the expense to any workspace.
  4. Tap on "Search" on the bottom of the screen.
  5. Tap on "Outstanding"
  6. Tap on "Pay" on the preview of the just created expense.
  7. Tap on the FAB and select "Submit Expense"
  8. Complete the expense creation flow and send the expense to the same workspace of the just paid expense.
  9. Tap on "All"
  10. Open the report of the two workspace expenses.
  11. Verify the new expense was created properly and is displayed on search section.

Expected Result:

The user should be able to create a new expense and send it to the same workspace of the just paid one, and this new expense should be displayed properly on "Search" section.

Actual Result:

When the user pay an expense via "Pay" button on expense preview on search, create another one and send it to the same workspace, an "Unexpected error" is displayed and the new expense is not created.
Issue can be reproduced only with Gmail accounts.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6662199_1731396212678.Unexpected.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @luacmartins
Issue OwnerCurrent Issue Owner: @luacmartins
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

Triggered auto assignment to @joekaufmanexpensify (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.

Copy link

melvin-bot bot commented Nov 12, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 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 Nov 12, 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.

@joekaufmanexpensify
Copy link
Contributor

I can't reproduce this on my gmail.com account. Works fine for me. I see the issue title says Android, but multiple platforms are selected, so I tested on web.

2024-11-12_10-32-39.mp4

@joekaufmanexpensify
Copy link
Contributor

@Beamanator are you able to reproduce?

@francoisl
Copy link
Contributor

I can repro – it's worth noting that it only seems to happen with distance expenses. Going to check logs.

@francoisl
Copy link
Contributor

https://www.expensify.com/_devportal/tools/logSearch/#query=request_id:(%228e18b520debecef5-SJC%22)+AND+timestamp:[2024-11-12T17:50:24.790Z+TO+2024-11-12T19:50:24.790Z]&index=logs_expensify-031172

403 New request cannot be added to this expense report - given the error, it's surprising that it would only happen on Android. I'll try to repro on web, it would be easier to troubleshoot.

@francoisl francoisl assigned francoisl and unassigned Beamanator Nov 12, 2024
@francoisl
Copy link
Contributor

francoisl commented Nov 12, 2024

Looks like this is fixed on main, there's probably something that's been merged we just need to CP 👀
Actually maybe not, I was still able to repro on main. Super confused here.

@francoisl
Copy link
Contributor

cc @luacmartins if you have any idea, since this is related to Search.

@francoisl
Copy link
Contributor

Ok I think I finally figured out exactly why it's happening and why I couldn't repro consistently. I think it's a backend issue – when you pay an expense from the Search page, the command PayMoneyRequestOnSearch doesn't update the status of the IOU report in Onyx, so when you try to create another expense, the client tries to create it on the same report as the previous one because it thinks it's still open, but in the backend the report is actually reimbursed.

image image

@luacmartins
Copy link
Contributor

@francoisl I'm reverting my PR which allows paying expenses on Search. I can take over this issue to fix it in the v2 of my PR if you'd like

@luacmartins
Copy link
Contributor

x, so when you try to create another expense, the client tries to create it on the same report as the previous one because it thinks it's still open

AFAIK the backend should handle this and just update the client.

@francoisl
Copy link
Contributor

Ok yeah, works for me if you don't mind. Thanks!

@francoisl francoisl assigned luacmartins and unassigned francoisl Nov 12, 2024
@francoisl
Copy link
Contributor

AFAIK the backend should handle this and just update the client.

Yeah that's what I was starting to look into - Auth only generates a snapshot_ update in this case (ref) - not super familiar with that feature so I wasn't sure if it's on purpose.

@francoisl francoisl removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Nov 13, 2024
@francoisl francoisl added Daily KSv2 Weekly KSv2 and removed Daily KSv2 labels Nov 13, 2024
@Beamanator
Copy link
Contributor

Thaaaaaaanks for getting this figured out gents 🙏

@luacmartins luacmartins changed the title Android - Expense - Unexpected error when submitting expense to same WS after paying another [Search v1.2] Android - Expense - Unexpected error when submitting expense to same WS after paying another Nov 13, 2024
@luacmartins luacmartins added Daily KSv2 and removed Weekly KSv2 labels Nov 13, 2024
@luacmartins
Copy link
Contributor

@joekaufmanexpensify I'm just keeping this open so I can track it in v2 of my PR that got reverted. I'll unassign you since we'll track that in the main issue.

@joekaufmanexpensify
Copy link
Contributor

Got it. TY!

@luacmartins luacmartins changed the title [Search v1.2] Android - Expense - Unexpected error when submitting expense to same WS after paying another [HOLD E/E 386310][Search v1.2] Android - Expense - Unexpected error when submitting expense to same WS after paying another Nov 14, 2024
@luacmartins luacmartins changed the title [HOLD E/E 386310][Search v1.2] Android - Expense - Unexpected error when submitting expense to same WS after paying another [Search v1.2] Android - Expense - Unexpected error when submitting expense to same WS after paying another Nov 15, 2024
@melvin-bot melvin-bot bot added the Overdue label Nov 18, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

@luacmartins Eep! 4 days overdue now. Issues have feelings too...

@luacmartins
Copy link
Contributor

I put up a fix for this and we'll retest once the App PR is merged

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
@luacmartins luacmartins added the Reviewing Has a PR in review label Nov 20, 2024
Copy link

melvin-bot bot commented Nov 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 Nov 26, 2024
@melvin-bot melvin-bot bot changed the title [Search v1.2] Android - Expense - Unexpected error when submitting expense to same WS after paying another [HOLD for payment 2024-12-03] [Search v1.2] Android - Expense - Unexpected error when submitting expense to same WS after paying another Nov 26, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 26, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.66-8 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-12-03. 🎊

Copy link

melvin-bot bot commented Nov 26, 2024

@luacmartins @luacmartins 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]

@luacmartins
Copy link
Contributor

This is done

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. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants