Skip to content

prevent live-tail cleanup from clearing RHP route params - #98020

Merged
cristipaval merged 2 commits into
Expensify:mainfrom
mukhrr:fix/92466
Aug 21, 2026
Merged

cristipaval merged 2 commits into
Expensify:mainfrom
mukhrr:fix/92466

Conversation

@mukhrr

@mukhrr mukhrr commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #92466
PROPOSAL: #92466 (comment)

Tests

  1. Open the Inbox.
  2. FAB → Create expense → Manual → enter any amount → Next.
  3. In the recipient field type the brand-new email → select it → Create expense.
  4. You land in the newly created DM with that user.
  5. Open the report and navigate back by clicking on ParentNavigationSubtitle
  6. Press + in the composer → Split expense → enter any amount → Split.
  7. The split preview appears in the chat. Click it within about one second of it appearing. This timing is the whole test — click it the instant it renders, don't pause to read the chat.
  8. The split details panel opens on the right and shows the amount and participants correctly.
  9. Now wait ~5 seconds and don't click anything.
  • Verify split expense detail appears

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Same as tests

  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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_app.mp4
Android: mWeb Chrome
android_web.mp4
iOS: Native
ios_app.mp4
iOS: mWeb Safari
ios_web.mp4
MacOS: Chrome / Safari
web.mp4

@mukhrr
mukhrr marked this pull request as ready for review August 7, 2026 06:12
@mukhrr
mukhrr requested review from a team as code owners August 7, 2026 06:12
@melvin-bot
melvin-bot Bot requested review from dmkt9 and heyjennahay and removed request for a team August 7, 2026 06:12
@melvin-bot

melvin-bot Bot commented Aug 7, 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 removed the request for review from a team August 7, 2026 06:12
@dmkt9

dmkt9 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot review

@MelvinBot

Copy link
Copy Markdown
Contributor

Review — LGTM ✅

The fix is correct and well-scoped. Swapping the global Navigation.setParams({reportActionID: ''}) for the screen-scoped navigation.setParams(...) is the right root-cause fix for #92466.

Why it works: the global helper dispatches SET_PARAMS with no source/target, so React Navigation applies it to the currently focused route. When the live-tail cleanup fires while the split-expense RHP is focused, it clears reportActionID on the RHP route instead of the REPORT screen, breaking the RHP into the "Not here" page. useNavigation() is bound to the REPORT screen, so navigation.setParams always targets that route regardless of what's focused. This matches the setParams docstring in Navigation.ts:692-695, which explicitly notes the default dispatch "would fail if a modal is focused."

Verification
  • Runtime (web): Reproduced the exact repro from #92466 — created an expense with a brand-new email → split → clicked the preview the instant it rendered. The Details panel opened correctly (amount $5.00, both participants at $2.50) and stayed stable after 5s. No "Not here"/Not Found page appeared. Screenshots attached below.
  • Lint: eslint passes clean on both changed files.
  • Unit test: The new useReportActionsNewActionLiveTailTest.ts is a solid regression test — it asserts the scoped setParams is called with {reportActionID: ''} and the global one is not, which captures the intent precisely. (I couldn't execute jest in this sandbox, so please confirm it's green in CI.)
  • Scope check: The hook only runs via ReportActionsList → ReportScreen (inside ReportsSplitNavigator), so useNavigation() always has a navigator context. navigation is a stable ref, so adding it to the effect deps is harmless.

Optional nit: the new useNavigation import lands on its own between the react-native-onyx and react imports rather than grouped with the other @react-navigation/library imports. Purely cosmetic — lint is clean — but grouping it would read a bit cleaner.


Runtime evidence (web)

Split details RHP opens immediately after instant click on split preview (fix works)

Split details RHP still correct after 5s wait (no Not Found)

@dmkt9

dmkt9 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@mukhrr I'm not sure I understand the steps in your desktop video. Why does the Pay button appear when you submit an expense to another user?

@mukhrr

mukhrr commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@mukhrr I'm not sure I understand the steps in your desktop video. Why does the Pay button appear when you submit an expense to another user?

@dmkt9 not sure, maybe since I enabled bank accounts on my account.

image

Does this (Pay button) really affect testing steps?

@dmkt9

dmkt9 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@dmkt9 not sure, maybe since I enabled bank accounts on my account.

@mukhrr No way. The Pay button should never be displayed to you. This behavior is strange and inconsistent with your other videos.

I just want to make sure there isn't something unusual happening here.

@mukhrr

mukhrr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@dmkt9 not sure, maybe since I enabled bank accounts on my account.

@mukhrr No way. The Pay button should never be displayed to you. This behavior is strange and inconsistent with your other videos.

I just want to make sure there isn't something unusual happening here.

@dmkt9 no no. It was not smth because of changes here. I have setup bank accounts on that testing account. Sorry for confusion.

@dmkt9

dmkt9 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Hi @heyjennahay, this PR will cause the content to scroll behind the RHP in the background, as shown in the videos below. Does this behavior look good to you?

Desktop:

mac.safari.mp4

Mobile:

ios.hybrid.mp4

@dmkt9

dmkt9 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@dmkt9 no no. It was not smth because of changes here. I have setup bank accounts on that testing account. Sorry for confusion.

@mukhrr Yes, I know that. But someone from the Production team will review these videos and confirm whether the PR looks good. So I also want to make sure there isn't anything unusual in the videos.

@dmkt9

dmkt9 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@mukhrr Additionally, can you add a step after step 4:

Open the report and navigate back by clicking on ParentNavigationSubtitle.

This will ensure the issue can be reproduced consistently.

@mukhrr

mukhrr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@mukhrr Additionally, can you add a step after step 4:

Open the report and navigate back by clicking on ParentNavigationSubtitle.

This will ensure the issue can be reproduced consistently.

added.. does it look good?

@dmkt9

dmkt9 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

added.. does it look good?

Yes. Thanks

@mukhrr

mukhrr commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor Author

this PR will cause the content to scroll behind the RHP in the background, as shown in the videos below. Does this behavior look good to you?

@trjExpensify can you pls us here? it seems @heyjennahay is not available cc @dmkt9

@heyjennahay

Copy link
Copy Markdown
Contributor

Sorry for the slow reply. Is the reason the scrolling occurs is because there is a new transaction that has been created and you're being scrolled to that? If so then I don't think that's an issue. But let me know if I've understood it wrong?

@trjExpensify

Copy link
Copy Markdown
Contributor

Prior to this PR, would the content jump to put the full preview in view if you click a preview of one which is "peeking" into view when navigating back to the parent chat? It feels a bit of an odd side-effect to introduce to fix the bug in the OP of the issue this PR was created for.

@mukhrr

mukhrr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Is the reason the scrolling occurs is because there is a new transaction that has been created and you're being scrolled to that?

yes

@mukhrr

mukhrr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Prior to this PR, would the content jump to put the full preview in view if you click a preview of one which is "peeking" into view when navigating back to the parent chat? It feels a bit of an odd side-effect to introduce to fix the bug in the OP of the issue this PR was created for.

@trjExpensify sorry. Can you elaborate a bit ,pls?

@dmkt9

dmkt9 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Prior to this PR, would the content jump to put the full preview in view if you click a preview of one which is "peeking" into view when navigating back to the parent chat? It feels a bit of an odd side-effect to introduce to fix the bug in the OP of the issue this PR was created for.

@trjExpensify I'm not sure I fully understand your comment. FYI, scrolling to the latest item is existing behavior—it wasn't introduced by this PR.

So when you mention "an odd side-effect", do you mean:

  • the content scrolling in general, or
  • the content scrolling even while the RHP is open?

@trjExpensify

Copy link
Copy Markdown
Contributor

I meant the content scrolling when you click on a preview that's not fully in the scroll view here:

image

If that is only because of the split that was created prior to the click, then it seems fine and expected. If it's now behaviour for any click of a preview not fully in the scroll view, that would be an unintended side-effect of this PR.

Sounds like it's just the former?

@mountiny

Copy link
Copy Markdown
Contributor

From what I understood its because of the split, can you please confirm @mukhrr @dmkt9 ?

@dmkt9

dmkt9 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

If that is only because of the split that was created prior to the click, then it seems fine and expected. If it's now behaviour for any click of a preview not fully in the scroll view, that would be an unintended side-effect of this PR.

From what I understood its because of the split, can you please confirm @mukhrr @dmkt9 ?

@mountiny @trjExpensify Thanks. Yeah, the scroll happens because we submit a split expense

@trjExpensify

Copy link
Copy Markdown
Contributor

Cool, all good from me then. 👍

@dmkt9

dmkt9 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

@mukhrr Can you merge the latest main branch?

@mukhrr

mukhrr commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@mukhrr Can you merge the latest main branch?

@dmkt9 done

@dmkt9

dmkt9 commented Aug 21, 2026

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.hybrid.mp4
Android: mWeb Chrome
android.chrome.mp4
iOS: HybridApp
ios.hybrid.mp4
iOS: mWeb Safari
ios.safari.mp4
MacOS: Chrome / Safari
mac.safari.mp4

@dmkt9 dmkt9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@melvin-bot
melvin-bot Bot requested a review from cristipaval August 21, 2026 07:09
@cristipaval
cristipaval merged commit 3c5a311 into Expensify:main Aug 21, 2026
36 of 38 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 cristipaval 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 OSBotify mentioned this pull request Aug 22, 2026
61 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/cristipaval in version: 9.4.59-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site changes required

I reviewed the changes in this PR and no updates to the help site (docs/articles) are needed.

Why: This is a purely internal navigation bug fix. It swaps a global Navigation.setParams({reportActionID: ''}) call for a screen-scoped navigation.setParams(...) in useReportActionsNewActionLiveTail.ts so the live-tail cleanup no longer clobbers the RHP route params — fixing the "Not here" page that appeared when opening a split expense right after creating an expense from the FAB (#92466).

The fix restores the already-expected behavior (the split details panel opens as it should). It introduces no new feature, setting, tab, label, button, or user-facing workflow, and it doesn't change any behavior described in the existing help articles (e.g. Split-Expenses.md). There's nothing here to document.

Since no docs changes are needed, I did not open a draft help site PR — so there's no help site PR to review or mark Ready for review. @mukhrr, if you think a specific article should still be updated, let me know which one and what behavior it's missing.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.59-5 🚀

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

Bundle Size Analysis (Sentry):

@mananjadhav

Copy link
Copy Markdown
Collaborator

When we replaced the Navigation.setParams singleton call with the hook-derived navigation.setParams, we caused a regression #99517

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.

9 participants