Skip to content

Fix Submit to my employer: Report field showing None and back button swapping the report - #97057

Merged
iwiznia merged 4 commits into
Expensify:mainfrom
abzokhattab:fix/96798-submit-to-employer-draft-report-id
Jul 29, 2026
Merged

iwiznia merged 4 commits into
Expensify:mainfrom
abzokhattab:fix/96798-submit-to-employer-draft-report-id

Conversation

@abzokhattab

@abzokhattab abzokhattab commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Two bugs in the "Submit to my employer" flow, both caused by the destination picker being auto-skipped.

1. Report field shows "None" instead of "New report" (#96798)

The picker is what rebinds the draft transaction from the self DM's unreported reportID to the destination expense chat. The two branches that skip it (exactly one accessible workspace, and restricted to a preferred workspace) set the participants but never the reportID, so the confirmation page still reads the draft as unreported: it renders "None" and resolves the policy from the self DM instead of the destination workspace. Both branches now call setMoneyRequestReportID, like every other path that binds an expense to a destination. The multi-workspace path is untouched.

2. Back button swaps the central pane to the self DM (#96796)

The confirmation page's backTo pointed at the report the expense lives on (the self DM), not the report the user is looking at — they may have drilled into the expense thread first. Going back to a report route resolves to a POP_TO on the tab navigator, which rebuilds the central pane and swaps the report out from under them. backTo now points at the report displayed behind the RHP, falling back to the expense's report when no report is visible (e.g. the flow was started from Search).

Fixed Issues

$ #96798
$ #96796
PROPOSAL:

Tests

Test 1 — Report field shows "New report" (#96798). With the submit2026 beta enabled, on an account that is a member of exactly one paid workspace:

  1. Go to your self DM and create a tracked expense.
  2. On the tracked expense whisper, click Submit it to my employer.
  3. Verify the confirmation page opens directly, with no destination picker, and the workspace as the destination.
  4. Verify the Report field shows New report, not None.
  5. Submit and verify the expense lands on a new report in that workspace.

Test 2 — Back button keeps the report you were on (#96796). On an account with no workspace:

  1. Go to your self DM and create an expense.
  2. Open the expense, then click on the header to open its details.
  3. Click Submit to my employer.
  4. On the confirmation page, click the RHP back button.
  5. Verify the RHP closes and the expense thread is still the open report. Before this change the central pane swapped to the self DM.
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline.
  2. Create a tracked expense in the self DM and click Submit it to my employer with exactly one accessible workspace.
  3. Verify the confirmation page shows New report in the Report field while offline.
  4. Go back and verify you land on the report you were viewing.
  5. Go back online and verify the expense submits to the workspace without errors.

QA Steps

  1. On an account with the submit2026 beta and exactly one paid workspace, create a tracked expense in the self DM and click Submit it to my employer.
  2. Verify the Report field reads New report instead of None, then submit and verify the expense lands on a new report in that workspace.
  3. Repeat with an account belonging to multiple paid workspaces and verify the destination picker is unchanged.
  4. On an account with no workspace, create an expense in the self DM, open the expense, click the header, click Submit to my employer, then click the RHP back button.
  5. Verify the RHP closes and the expense thread stays open instead of switching to the self DM.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-07-27.at.21.39.05.mov
iOS: mWeb Safari
Screen.Recording.2026-07-27.at.21.40.43.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-27.at.21.29.57.mov

…cker is skipped

"Submit to my employer" auto-skips the destination picker when there is exactly one
accessible workspace, but the picker is also what rebinds the draft transaction from the
self DM's unreported ID to the destination expense chat. Skipping it left the draft
unreported, so the confirmation page rendered "None" for the report instead of
"New report" and resolved the policy from the self DM rather than the destination
workspace.

The restricted-preferred-workspace branch skips the picker the same way and had the same
gap, so it gets the same binding.
@codecov

codecov Bot commented Jul 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/ReportUtils.ts 86.57% <75.00%> (+0.41%) ⬆️
... and 11 files with indirect coverage changes

The confirmation page's backTo pointed at the report the tracked expense lives on (the
self DM), but the user may have drilled into the expense thread before starting the flow.
A report route resolves to TAB_NAVIGATOR -> REPORTS_SPLIT_NAVIGATOR -> REPORT, and because
the RHP is focused, goUp cannot descend into the tab navigator: it matches the tab
navigator at the root and dispatches POP_TO, which rebuilds the central pane from the
payload. So going back closed the RHP and swapped the central pane to the self DM.

Point backTo at the report actually displayed behind the RHP, falling back to the expense's
report when no report is the topmost fullscreen (e.g. the flow was started from Search).
@abzokhattab abzokhattab changed the title Fix Report field showing None when Submit to my employer skips the destination picker Fix Submit to my employer: Report field showing None and back button swapping the report Jul 27, 2026
The flow's unit tests mock isReportTopmostSplitNavigator, so nothing verified that the
real helper resolves the report behind an RHP. Assert it against a real navigation
container for both the report tab and the Search tab.
@abzokhattab
abzokhattab marked this pull request as ready for review July 27, 2026 19:43
@abzokhattab
abzokhattab requested review from a team as code owners July 27, 2026 19:43
@melvin-bot
melvin-bot Bot requested a review from dmkt9 July 27, 2026 19:43
@melvin-bot

melvin-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

@dmkt9 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from joekaufmanexpensify and removed request for a team July 27, 2026 19:43
@abzokhattab

Copy link
Copy Markdown
Contributor Author

@hungvu193 this is ready for review

@hungvu193
hungvu193 requested review from hungvu193 and removed request for dmkt9 July 28, 2026 02:51
@hungvu193

Copy link
Copy Markdown
Contributor

Sorry for the ping @dmkt9. I'll handle it

@hungvu193

Copy link
Copy Markdown
Contributor

Both issues are fixed. I'm reviewing the codes

Screen.Recording.2026-07-28.at.10.12.26.mov
Screen.Recording.2026-07-28.at.10.11.11.mov

@hungvu193

Copy link
Copy Markdown
Contributor

@abzokhattab When I try to create an expense it shows "Unvailable Workspace", could you check? I'm not able to reproduce it on main.

Screen.Recording.2026-07-28.at.10.10.55.mov

@hungvu193

hungvu193 commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Here's on main:

Screen.Recording.2026-07-28.at.13.44.50.mov
Screen.Recording.2026-07-28.at.13.47.14.mov

@abzokhattab

Copy link
Copy Markdown
Contributor Author

Hmm, I am trying to reproduce that but i dont have it .. do u have specfic reproduce steps ?

Screen.Recording.2026-07-28.at.12.20.07.mov

also i just merged to main to resync let me know if that fixes it

@hungvu193

Copy link
Copy Markdown
Contributor

Yep, I'm also not able to reproduce it after merge main

@hungvu193

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-07-28.at.10.12.26.mov
Screen.Recording.2026-07-28.at.10.11.11.mov

@hungvu193
hungvu193 requested a review from iwiznia July 29, 2026 03:05
@iwiznia
iwiznia merged commit f9e6fa9 into Expensify:main Jul 29, 2026
34 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 iwiznia has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/iwiznia in version: 9.4.46-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required — no draft PR created.

I reviewed the changes in this PR against the help site articles in docs/articles, applying HELPSITE_NAMING_CONVENTIONS.md, HELP_AUTHORING_GUIDELINES.md, and TEMPLATE.md.

Both changes are bug fixes that restore the flow's already-intended behavior, not new or changed user-facing functionality:

  1. Report field showing "None" → "New report" ([Due for payment 2026-08-07] Expense - Report field shows "None" when submitting track expense to employer. #96798): The confirmation page now correctly binds the draft transaction to the destination workspace chat when the destination picker is auto-skipped. The intended, documentable behavior ("New report") is unchanged — the bug simply prevented it from displaying.
  2. Back button swapping the central pane ([Due for payment 2026-08-07] Expense - RHP back button on confirm page changes report from expense thread to self DM #96796): backTo now points at the report the user is actually viewing. This is an internal navigation correction with no user-facing feature change.

There are no new features, settings, tabs, buttons, or workflows to document, and no existing help article describes the "Submit to my employer" self-DM tracked-expense flow — so nothing on the help site is now inaccurate or missing as a result of this PR.

@abzokhattab, if you believe there's a customer-facing behavior here that should be documented (e.g. a new help article for the "Submit to my employer" flow), let me know and I'll draft the help site PR for you to review and mark Ready for review.

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #97437 was identified to be related to this PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants