Repository navigation
Remove Onyx.connect() usage for ONYXKEYS.COLLECTION.REPORTS from src/libs/actions/IOU/Transaction.ts - #93734
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
…-fork into Guccio163/onyx-connect/transaction/report
|
@DylanDylann 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: e5a7cc16a6
ℹ️ 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".
|
No product review needed |
…-fork into Guccio163/onyx-connect/transaction/report
…-fork into Guccio163/onyx-connect/transaction/report
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c70ce5a0bd
ℹ️ 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".
Resolved conflicts: - Kept onyx-connect changes (reports param / removed global allReports Onyx.connect) - Took main's version for files only carried as stale-main snapshots - Restored GroupCurrencyPopup.tsx from main - Consolidated DynamicIOURequestStepUpgradePage.tsx -> IOURequestStepUpgrade.tsx (main's name) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@DylanDylann kindly bump here 👀 |
…-fork into Guccio163/onyx-connect/transaction/report
The feature they tested (moving all matching expenses via jsonQuery + hash) was reverted from Transaction.ts on main in d51ada0, but the merge into this branch left the tests behind, referencing fields (jsonQuery, hash) that no longer exist on ChangeTransactionsReportProps.
|
@DylanDylann ready ✅ |
|
|
||
| if (isEditing) { | ||
| const policyTagList = item?.policyID ? allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${item.policyID}`] : {}; | ||
| const reportsForCall = report?.reportID ? {[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report, ...reports} : reports; |
There was a problem hiding this comment.
Why do we need to update the reports here?
There was a problem hiding this comment.
We need it because the hook here doesn't know the destination report yet when it runs — report is only picked later, inside this callback, so reports never contains it.
changeTransactionsReport's failure-rollback path reads the target report straight from reports, with no fallback to the newReport param (unlike the optimistic-update path, which does have that fallback). So if reports is missing the destination report, the rollback value on API failure is undefined — and since Onyx.merge ignores undefined, a failed request would leave the destination report's total/transactionCount stuck at the optimistic (wrong) value instead of rolling back.
Merging report in here fixes that. It's the same thing other callers of this hook already do for the same reason (SearchTransactionsChangeReport.tsx, DynamicIOURequestEditReport.tsx, IOURequestStepUpgrade.tsx, DynamicNewReportWorkspaceSelectionPage.tsx).
…RT_ID lookups Accept the resolved transactions and destination reportID directly instead of a transactionIDs/allTransactions pair, dropping the per-caller collection-building boilerplate. Also always include CONST.REPORT.UNREPORTED_REPORT_ID in the resolved report ids, matching what getChangeTransactionsReportOnyxData looks up for unreported transactions.
|
@DylanDylann applied the changes/replied to the comment, please take a look |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-08-10.at.16.47.16.mov |
|
@Guccio163 Could you please resolve conflict? |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a4d4adb50
ℹ️ 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".
…-fork into Guccio163/onyx-connect/transaction/report
…s before moving expenses into them createNewReport's optimistic report leaves these two fields undefined, so changeTransactionsReport's failure rollback (which reads them off the reports snapshot) was a no-op on API failure, leaving the optimistic bump stuck. Matches the same zero-seeding already done in the analogous create-new-report flows.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@DylanDylann ready |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #67779 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 mjasikowski 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.4.53-0 🚀
|
|
🤖 I reviewed the changes in this PR against the help site content in No help site documentation changes are required. This PR is an internal code refactor: it removes the module-level There are no changes to user-facing behavior, features, UI labels, tab names, buttons, or workflows — nothing that the public help articles describe. As a result, there's no draft PR to open. @Guccio163, if you believe this refactor does change any documented user-facing behavior, let me know which flow and I'll re-check and open a docs PR if needed. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.53-10 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
This PR is part of a refactor to remove Onyx.connect for the keys: ONYXKEYS.COLLECTION.REPORT from the src/libs/actions/IOU/Transation.ts file and replace it with useOnyx.
It adds the
reportsargument to thechangeTransactionsReportfunction, extracted and filtered from the ONYXKEYS.COLLECTION.REPORT Onyx.connect key .Fixed Issues
$ #67779
PROPOSAL:
Tests
Prerequisites
Steps
preserved.
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-06-22.at.12.50.34.mov