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

fix(routing): async message pickup on init #1093

Conversation

genaris
Copy link
Contributor

@genaris genaris commented Nov 9, 2022

Currently, when initializing the agent using a MediationPickupStrategy different from None (e.g. PickupV1 or PickupV2), it attempts to start message pickup in a synchronous way, meaning that it might take some more time for startup depending on the . Also, if mediator is not reachable at that moment, it will throw an error and Agent's _isInitialized flag will not be set to true even if can connect afterwards (with the polling of PickupV1 or backoff strategy of PickupV2).

In this PR we are starting the message pickup process in an async way and catching any possible initial error, in a similar way as Agent's initialize method for connecting to ledger pools.

@genaris genaris requested a review from a team as a code owner November 9, 2022 13:02
@TimoGlastra
Copy link
Contributor

Makes sense 👍 I've currently handled it by setting it to None and starting pickup manually afterwards. I think handling this better by default means less custom code and if you need more control you can just set it to None and handle it yourself

@genaris
Copy link
Contributor Author

genaris commented Nov 9, 2022

Makes sense +1 I've currently handled it by setting it to None and starting pickup manually afterwards. I think handling this better by default means less custom code and if you need more control you can just set it to None and handle it yourself

Yes, actually I noticed this while writing the tutorial for message pickup that I owe since several weeks 😅. There will be the suggestion of using None and handle the cycle manually depending on network status.

@genaris genaris merged commit 15cfd91 into openwallet-foundation:main Nov 9, 2022
@genaris genaris deleted the fix/mediation-recipient-initialize branch November 9, 2022 14:41
NB-MikeRichardson added a commit to NB-MikeRichardson/aries-framework-javascript that referenced this pull request Nov 10, 2022
fix(routing): async message pickup on init (openwallet-foundation#1093)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants