Skip to content

Expense - Track expense preview shows "View" on chat but "Submit" is displayed on "Reports" #62152

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

Open
3 of 8 tasks
mitarachim opened this issue May 16, 2025 · 12 comments
Open
3 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. DeployBlockerCash This issue or pull request should block deployment Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@mitarachim
Copy link

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.1.46-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome
App Component: Money Requests

Action Performed:

  1. Open the Expensify app.
  2. Sign up with a new account.
  3. Complete onboarding modal selecting "Track and budget expenses" option.
  4. Once redirected to inbox, tap on FAB and select "Create Expense"
  5. Complete the creation flow and submit it to Self DM.
  6. Tap on "Share with my accountant" option below expense preview.
  7. Add an accountant.
  8. Add a merchant and category and submit expense.
  9. Note that expense preview on chat, displays a "View" button.
  10. Navigate to "Reports"
  11. Note that the same expense, displays a "Submit" button on preview.

Expected Result:

Expense should display a "Submit" button on preview, both on chat and on "Reports" section.

Actual Result:

When submitting a track expense to a new workspace, the expense preview on chat, shows a "View" button, while preview on "Reports" displays a "Submit" button.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6832607_1747352758608.Preview.mp4

View all open jobs on GitHub

@mitarachim mitarachim added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels May 16, 2025
Copy link

melvin-bot bot commented May 16, 2025

Triggered auto assignment to @zanyrenney (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 May 16, 2025

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels May 16, 2025
Copy link

melvin-bot bot commented May 16, 2025

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

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.

When submitting a track expense to a new workspace, the expense preview on chat, shows a "View" button, while preview on "Reports" displays a "Submit" button.

What is the root cause of that problem?

It's a problem with canSubmit function but it's visible after this PR that removed the old ReportPreview component and used the new component. We only allow submitting the report if it's manually submitted

return isExpense && isSubmitter && isOpen && isManualSubmitEnabled && !hasAnyViolations && !isAnyReceiptBeingScanned;

it's different with secondary action here

const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL;

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

We should change isManualSubmitEnabled to isScheduledSubmitEnabled condition here

return isExpense && isSubmitter && isOpen && isManualSubmitEnabled && !hasAnyViolations && !isAnyReceiptBeingScanned;

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.

@MonilBhavsar MonilBhavsar removed the DeployBlocker Indicates it should block deploying the API label May 16, 2025
@zanyrenney
Copy link
Contributor

@MonilBhavsar any thoughts here on if they should remain a deploy blocker and on the proposal above? Thank you.

@MonilBhavsar
Copy link
Contributor

Was checking another blocker, looking now

@MonilBhavsar
Copy link
Contributor

MonilBhavsar commented May 16, 2025

Requested retest as I am seeing this on production too https://expensify.slack.com/archives/C9YU7BX5M/p1747397824103739

@IuliiaHerets
Copy link

@MonilBhavsar Issue is still repro on the latest build

screen-20250516-095010.mp4

@IuliiaHerets
Copy link

Different behaviour in production.
On STG, the preview in the chat shows the word ‘View’, and ‘Send’ is only shown in ‘Reports’. On Prod, ‘Send’ can be seen in both cases

screen-20250516-101654.mp4

@luacmartins luacmartins self-assigned this May 16, 2025
@IuliiaHerets
Copy link

@MonilBhavsar Issue is not reproducing with Expensifail account, both stg and prod. "Submit" button appears on chat and on "Reports"

https://github.com/user-attachments/assets/1564260d-e50c-4982-bf82-4e27038777f5
https://github.com/user-attachments/assets/83021617-a120-47d4-b36f-9c379ea7ee26

@luacmartins
Copy link
Contributor

Solution above is incorrect. We have different conditions for the primary action (only when submit manually is true) and secondary actions (when scheduled submit is enabled - any frequency). The real issue is that when we share the report with our accountant, we're creating a report in OPEN state, but the workspace created has autoReportingFrequency: "immediate" set, which breaks the current logic.

Discussing it here

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. DeployBlockerCash This issue or pull request should block deployment Engineering Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants