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

Check connection acknowledgement for all messages, not just trust ping and ack #96

Open
TimoGlastra opened this issue Sep 6, 2020 · 0 comments

Comments

@TimoGlastra
Copy link
Contributor

TimoGlastra commented Sep 6, 2020

Currently when receiving a trust ping or ack message we check whether the connection state is not yet completed. If this is the case we set the connection state to Complete.

However per the connection RFC on connection acknowledgement: "As any message will confirm the connection, any message will do."

So we need to move this implementation to a place where it will be run for every incoming message. I think the best way would be to allow for agent middleware, see #97 . After this is implemented we could address this issue.

// TODO: This is better addressed in a middleware of some kind because
// any message can transition the state to complete, not just an ack or trust ping
if (connection.state == ConnectionState.Responded && connection.role === ConnectionRole.Inviter) {
  await this.connectionService.updateState(connection, ConnectionState.Complete);
}
@TimoGlastra TimoGlastra mentioned this issue Sep 6, 2020
3 tasks
@TimoGlastra TimoGlastra added this to the 0.1 milestone Mar 5, 2021
@TimoGlastra TimoGlastra removed this from the 0.1 milestone Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant