-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat: query transactions on networks independently #5528
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5528 +/- ##
=======================================
Coverage 86.46% 86.46%
=======================================
Files 762 762
Lines 31456 31481 +25
Branches 5422 5427 +5
=======================================
+ Hits 27197 27219 +22
- Misses 4028 4031 +3
Partials 231 231
... and 1 file 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.
Awesome! Thanks for working on this! 🚀
if (activeRequests[networkId]) { | ||
Logger.info(TAG, `Skipping fetch for ${networkId} as it is already active`) | ||
return |
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.
I'm wondering if we could avoid that check and the need to pass setActiveRequests
/ activeRequests
Is the problem that useAsync
can call queryTransactionsFeed
multiple times, but we effectively only care about the last one?
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.
I added this because some slow networks, such as polygon, take longer than the polling interval to return a result, so we can end up with multiple pending requests that are slow to resolve.
src/transactions/feed/queryHelper.ts
Outdated
address, | ||
localCurrencyCode, | ||
params: allowedNetworkIds.map((networkId) => { | ||
return { networkId } | ||
}), | ||
updateTransactionState: (networkId, result) => { |
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.
I wonder if we need to worry that this is handled only for the "current" promise of queryTransactionsFeed
.
But maybe since the result is deduplicated it's fine?
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.
We also handle the pending states for polling and pagination separately so it should only fire one request of each type per network.
Description
Alternative implementation of #5432 which addresses the comments raised in #5432 (comment) passing state and setState to the
queryTransactionsFeed
function.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: