refactor: isolate dismissDuplicateTransactionViolation from Onyx.connect data#72955
Conversation
Codecov Report❌ Patch coverage is
... and 9 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…nnect/dismissDuplicateTransactionViolation-src-libs-actions-Transaction.ts
…nnect/dismissDuplicateTransactionViolation-src-libs-actions-Transaction.ts
There was a problem hiding this comment.
file with test for actions/Transaction.ts exist under path tests/unit/TransactionTest.ts.
I would keep only one file with tests for Transaction.
You can choose which is better old or new one and move all tests there.
There was a problem hiding this comment.
Okay, I moved my tests to already existing file with unit tests
|
@DylanDylann @tgolen One of you needs to 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] |
| const [allTransactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: false}); | ||
| const [allTransactionViolation] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: false}); |
There was a problem hiding this comment.
Can these use selectors at all? It looks like they should each be using a selector to only get the transactionIDs transactions.
There was a problem hiding this comment.
You mean to select only these transactions and transactionViolation with ids from transactionIDs?
…nnect/dismissDuplicateTransactionViolation-src-libs-actions-Transaction.ts
…nnect/dismissDuplicateTransactionViolation-src-libs-actions-Transaction.ts
bfdbbbf to
1d09d0f
Compare
tgolen
left a comment
There was a problem hiding this comment.
Please don't force push on your branches once they have begun to be reviewed. It loses all the history when you do that.
|
Any next steps other than a merge? @tgolen |
|
Looks like it needs a checklist from @DylanDylann |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2025-11-04.at.18.10.45.movAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ 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/tgolen in version: 9.2.44-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.44-5 🚀
|
Explanation of Change
This PR is part of a refactor to remove Onyx.connect for the keys:
ONYXKEYS.COLLECTION.TRANSACTIONandONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONSfrom thesrc/libs/actions/Transaction.tsfile and replace it with useOnyx.It isolates the dismissDuplicateTransactionViolation function from the Onyx.connect data.
To ensure this refactor doesn't break anything, it adds automated tests to the dismissDuplicateTransactionViolation function.
Fixed Issues
$ #67777
$ #67780
PROPOSAL:
Tests
Keep allbutton, it should dismiss the violationsOffline tests
Same as Tests
QA Steps
Same as Tests
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
web2.mov