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

Unable to process requests from multi-use invitations when agent uses mediation #1138

Open
genaris opened this issue Dec 3, 2022 · 4 comments

Comments

@genaris
Copy link
Contributor

genaris commented Dec 3, 2022

This is a case where a mobile agent (which uses a mediator for incoming messages) creates a multi-use out of band invitation with autoAcceptConnection enabled, and another agent receives it.

At the moment of processing the DIDExchangeRequest or ConnectionRequest, the mobile agent will generate a new key pair and do a KeyListUpdate to inform the mediator and wait for the response before proceeding (in the loop from keylistUpdateAndAwait). The Agent sends the message and the mediator replies with the KeyListUpdateResponse, but the Agent is not able to get the AgentMessageReceived event generated, so a TimeoutError is thrown. Actually, the AgentMessageReceived event seems to be emitted only after the previous error is thrown and Dispatcher's loop is finished.

Note: this issue has been tested under React Native. Not sure if it happens also under Node.JS environment.

@TimoGlastra
Copy link
Contributor

but the Agent is not able to get the AgentMessageReceived event generated

Any idea why this is?

@genaris
Copy link
Contributor Author

genaris commented Dec 3, 2022

but the Agent is not able to get the AgentMessageReceived event generated

Any idea why this is?

I don't know about rxjs/React Native EventEmitter internals, but I'm wondering if this could be related to the fact that, when we are processing the ConnectionRequest message, we are under an AgentMessageReceivedEvent listener (see Agent.ts#L118), and we are trying to subscribe to a KeylistUpdatedEvent (in keylistUpdateAndAwait) that ultimately depends on the reception of the very same event (to receive the KeyListUpdateResponse message and execute the corresponding handler).

Could this event execution nesting be an issue?

@genaris
Copy link
Contributor Author

genaris commented Dec 12, 2022

In #1143 we added a test in packages/core/tests/connections.test.ts that checks this particular flow and works properly. So that leaves me the idea that it could be React Native specific (maybe something related to the way native EventEmitter class works in that platform 🤔).

@sudddy
Copy link

sudddy commented Sep 1, 2023

@genaris I'm facing the exact same issue even now.
The mobile agent sends out a multi-use out-of-band invitation with autoAcceptConnection enabled, and timeout occurs. But, it keeps trying and gets connected to the mediator using a different outOfBandId. #1562 - Described it here.

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

No branches or pull requests

3 participants