Repository navigation
Fix: Hydrate snapshot reports into live Onyx on SearchTransactionsChangeReport mount - #93112
Conversation
…ngeReport mount Signed-off-by: “karan-1302” <karangupta95797@gmail.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Signed-off-by: “karan-1302” <karangupta95797@gmail.com>
…hot merge Signed-off-by: “karan-1302” <karangupta95797@gmail.com>
|
@Krishna2323 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ac8e4d371
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: “karan-1302” <karangupta95797@gmail.com>
| "../../src/pages/Search/SearchSavePage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 3 | ||
| "../../src/pages/Search/SearchTransactionsChangeReport.tsx" "@typescript-eslint/no-deprecated/InteractionManager.runAfterInteractions" 1 | ||
| "../../src/pages/Search/SearchTransactionsChangeReport.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 | ||
| "../../src/pages/Search/SearchTransactionsChangeReport.tsx" "@typescript-eslint/no-unsafe-type-assertion" 2 |
There was a problem hiding this comment.
The seatbelt bump (1 → 2) is needed because we cast the string key from Object.keys() to a typed Onyx report key. TypeScript can't narrow this automatically, so the as cast is unavoidable — same pattern used elsewhere in Search code.
trjExpensify
left a comment
There was a problem hiding this comment.
Been chatting about this one on the parent issue. Good from product with this fix! 👍
|
Will complete the checklist within an hour, ESLint fail isn't related. |
|
@trjExpensify @luacmartins I tested on Monosnap.screencast.2026-06-11.05-55-26.mp4 |
|
I wasn't aware of this bug. Although, the expense doesn't seem to have been moved in your video, so I'm not sure that I completely understand the issue. |
The expense should have been moved to the selected report dated |
|
Yea, that's what I'd expect. |
|
Why didn't it move? |
I'll investigate that shortly, but should we block this PR because of it? I don't think it's related to this PR or the issue this fix addresses. |
|
Unless that bug was caused by this PR, I don't think we should block on it. |
|
@karan-1302 please merge main |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_hybrid.mp4Android: mWeb Chromeandroid_mWeb.mp4iOS: HybridAppios_hybrid.mp4iOS: mWeb Safariios_mWeb.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
FE sends the correct move ( My suspicion is that this is a BE source-of-truth or linked-report issue rather than anything related to the picker or hydration fix. |
@karan-1302 bump |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@Krishna2323 do you have better reproducible steps for this issue? I'm unable to reproduce it following the steps below:
|
@luacmartins It's only reproducible with a cardholder's unreported card transaction. The account should have a company card assigned to the user, and the user should already have a draft report. Then, on the admin account:
|
|
hmm I'm still unable to reproduce that following those steps. Here's a video with the admin moving the unreported card transaction to a new report. The member had several draft reports available Screen.Recording.2026-06-16.at.1.39.51.PM.mov |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.9-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Help site review: No documentation changes are required. This PR is an internal data-hydration bug fix. It hydrates snapshot reports from Search into live Onyx so that the Move to report picker correctly shows a cardholder's existing draft report (with the right avatar) without an admin having to open that report first. It restores the already-intended behavior of an existing feature — it does not add or change any user-facing feature, settings label, tab, button, or workflow. The relevant help articles (e.g. Because no help site content needs to change, no draft @karan-1302, please confirm you agree no help site updates are needed. If you believe a specific article should be updated, let me know which behavior to document and I'll open a draft PR. |
|
@karan-1302 @luacmartins @trjExpensify Applause can't test card transactions, can this be verified internally? |
@kavimuru why not? You have access on staging to import transactions from the "Mock bank" option in Company Cards, don't you? |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.9-0 🚀
|
|
@luacmartins the issue is only reproducible using the "Move to report" option in more menu on search page. Please check this recording: #93112 (comment) |
|
@Krishna2323 I still can't reproduce it Screen.Recording.2026-06-22.at.2.58.17.PM.mov |
@luacmartins Hmm, let's leave that for now then. Maybe it's only an issue with test card transactions? |
|
I'm not sure. I'm using test card transactions too 🤷 I'm cool with leaving this as is and see if we get any new reports of this issue. Thanks for helping with the debug. |
Explanation of Change
Fixed Issues
$ #92519
PROPOSAL: #92519 (comment)
Tests
Test 1: Bug fix
Test 2: Regression — reported transactions
Test 3: Regression — single expense (non-Search flow)
Offline tests
QA Steps
Same as tests.
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-06-11.at.12.37.41.AM.1.mov
Android: mWeb Chrome
Screen.Recording.2026-06-10.at.9.44.49.AM.mov
iOS: Native
Screen.Recording.2026-06-11.at.12.47.40.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-06-10.at.10.03.24.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-06-10.at.3.10.24.AM.mov