-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(TransactionFeedV2): Cleanup stand by transactions in Transaction Feed V2 #6146
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6146 +/- ##
========================================
Coverage 88.75% 88.76%
========================================
Files 727 727
Lines 30752 30776 +24
Branches 5624 5630 +6
========================================
+ Hits 27295 27319 +24
- Misses 3259 3414 +155
+ Partials 198 43 -155
... and 65 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
function cleanupStandByTransactions() { | ||
const confirmedPaginationTransactions = | ||
data?.transactions | ||
?.filter((tx) => tx.status !== TransactionStatus.Pending) | ||
.map((tx) => tx.transactionHash) || [] | ||
|
||
const standByTransactionsToRemove: string[] = [] | ||
for (const tx of standByTransactions.confirmed) { | ||
if (confirmedPaginationTransactions.includes(tx.transactionHash)) { | ||
standByTransactionsToRemove.push(tx.transactionHash) | ||
} | ||
} | ||
|
||
if (standByTransactionsToRemove.length) { | ||
dispatch(removeStandByTransactions(standByTransactionsToRemove)) | ||
} | ||
}, | ||
[data?.transactions, standByTransactions] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to move this logic to the reducer?
Acting on the successful fetched transactions action.
This way we follow more closely Redux best practices:
@jeanregisser updated |
Description
4th PR of RET-1207. This implements the cleanup of confirmed stand by transactions that are already present in the feed. Currently, we keep confirmed transactions in
standByTransactions
even if they are present in the pagination data. This is unnecessary as it takes extra space from the persisted storage.Test plan
Related issues
Backwards compatibility
Yes
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will: