Skip to content
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: make requestUnregisteredTokens concurrent #565

Merged
merged 9 commits into from
Sep 25, 2024

Conversation

alexruzenhack
Copy link
Contributor

@alexruzenhack alexruzenhack commented Sep 12, 2024

Motivation

The user needs the data as quick as possible in a new nano contract request. To achieve this requirement we can make the http request concurrent, however we should respect the rate-limit rules set in public node endpoints.

Acceptance Criteria

  • Make requestUnregisteredTokens to call token details in "parallel"
  • Add an action to end the request unregistered tokens process
  • Add an utility function to split a list in groups

Future possibility

We can implement a client object that implements a more sophisticated limit-rate strategy that adapts to back pressure from server. This control is interesting to pursuit in order to better rationalize the resources at app disposal and at the same time helps the server to heal in case of spike usage.

Note

It closes #531.

Warning

To work properly it depends on the fix on promise leak, see HathorNetwork/hathor-wallet-lib#772.

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@alexruzenhack alexruzenhack requested review from andreabadesso and r4mmer and removed request for pedroferreira1 September 12, 2024 16:27
@alexruzenhack alexruzenhack self-assigned this Sep 12, 2024
@alexruzenhack alexruzenhack changed the title feat: make requestUnregisteredTokens concurrent' feat: make requestUnregisteredTokens concurrent Sep 12, 2024
- add action UNREGISTEREDTOKENS_FAILURE
- add action UNREGISTEREDTOKENS_END
- rename action UREGISTEREDTOKENS_UPDATE to UREGISTEREDTOKENS_SUCCESS
- improve documentation
src/actions.js Outdated Show resolved Hide resolved
src/sagas/tokens.js Outdated Show resolved Hide resolved
src/utils.js Show resolved Hide resolved
@alexruzenhack alexruzenhack merged commit 088a834 into master Sep 25, 2024
1 check passed
@alexruzenhack alexruzenhack deleted the feat/add-concurrency-to-calls branch September 25, 2024 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Refactor fetchUnregisteredTokens effect to use concurrent calls
3 participants