Repository navigation
Remove Onyx.connect() usage for ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS as allTransactionViolations from src/libs/actions/IOU/Transaction.ts - #91196
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.
|
|
@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: 0339c9298d
ℹ️ 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 |
| const siblingNonDuplicatedViolations = (transactionViolations?.[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${id}`] ?? []).filter( | ||
| (violation: TransactionViolation) => violation.name !== CONST.VIOLATIONS.DUPLICATED_TRANSACTION, | ||
| ); | ||
| optimisticData.push({ | ||
| onyxMethod: Onyx.METHOD.SET, | ||
| key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${id}`, | ||
| value: allTransactionViolations.filter((violation: TransactionViolation) => violation.name !== CONST.VIOLATIONS.DUPLICATED_TRANSACTION), | ||
| value: siblingNonDuplicatedViolations, |
There was a problem hiding this comment.
As I understand it, If we have 2 duplicated expenses called A and B, and we remove expense A from the report, we need to remove the duplicated transaction warning from expense B's transaction violations. That's why we need to pass all transaction violations, to get expense B's violations and filter for DUPLICATED_TRANSACTION. I have 2 concerns:
- I'm not sure why we previously used allTransactionViolations.filter. As I understand it, we should only filter on expense B's violations.
- I'm wondering if we could only pass the duplicated expense's violations (in this example, only need to pass violations of expense B) instead of passing all transaction violations
…-fork into Guccio163/onyx-connect/transaction_violations/allTransactionViolations
|
@DylanDylann just as you noticed it looks like previous implementation had a bug. In the last commit I pushed a test file with a proof, take a look if it looks clear for you too and I'll remove it then. |
…-fork into Guccio163/onyx-connect/transaction_violations/allTransactionViolations
|
@DylanDylann I addressed the comments and made changes, please take a look when you're available 👀 |
…-fork into Guccio163/onyx-connect/transaction_violations/allTransactionViolations
|
Left two comments. The rest looks fine |
|
Thanks @DylanDylann , I just addressed both of them 👍 |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-06-18.at.13.46.45.mov |
…-fork into Guccio163/onyx-connect/transaction_violations/allTransactionViolations
|
@DylanDylann should be good to go, only waiting for checks to pass |
…-fork into Guccio163/onyx-connect/transaction_violations/allTransactionViolations
|
Hi @danieldoglas, kindly bump |
…-fork into Guccio163/onyx-connect/transaction_violations/allTransactionViolations
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 danieldoglas 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/danieldoglas in version: 9.4.19-1 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Help site review: no changes required. This PR is an internal refactor — it removes the module-level Since there is no change to feature names, UI labels, flows, or product behavior, no updates to the help site files under @Guccio163, if you believe a help site update is warranted here (e.g. behavior I may have missed), let me know and I'll create the draft PR. |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.19-5 🚀
|
Explanation of Change
This PR is part of a refactor to remove Onyx.connect for the keys: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS from the src/libs/actions/IOU/Transation.ts file and replace it with useOnyx.
It adds the
nonDuplicatedTransactionViolationsargument to thechangeTransactionsReportfunction, extracted and filtered from the ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS Onyx.connect key .Fixed Issues
$ #67780
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-05-20.at.20.16.02.mov