openwallet-foundation/credo-ts

Connection-less exchange fails when the holder has no endpoint

conanoc opened this issue · 1 comments

The scenario is as follows:

  • Issuer creates an oob-invitation attaching a credential-offer message and handshake: false
  • Holder has no endpoint
  • Holder tries to get a credential via connection-less exchange using transport-return-route

This scenario works with an ACA-Py issuer but fails with a Credo-ts issuer.

Reasons for the failure:

  • The issuer throws on getConnectionlessOutboundMessageContext() because it cannot find a service inside the message.
    • This could be changed to allow a message without a service.
  • If we allow the service-less message, it will throw on MessageSender.sendMessage() because connection is null.
    • We could put off the null check after session check because we can send the message via session without the connection.

Interesting use case. I think not including a service feels wrong as the service is also used to encrypt the message. But maybe it should use a service of didcomm:transport/queue (although it being queued is probably also not what you want).

I think we would have to check on the incoming message upfront if:

  • return route is enabled
  • a session is available for the incoming message
  • auto accept is enabled