You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The discussion in #2159 made me think that probably we can change the way we process requests (messages) in Out of Band invitations (e.g. flows involving proofs requests and credential issuance).
Currently, OutOfBandApi is doing, in its acceptInvitation method:
if (messages && messages.length > 0) {
this.logger.debug('Out of band message contains request messages.')
if (connectionRecord.isReady) {
await this.emitWithConnection(outOfBandRecord, connectionRecord, messages)
} else {
// Wait until the connection is ready and then pass the messages to the agent for further processing
this.connectionsApi
.returnWhenIsConnected(connectionRecord.id, { timeoutMs })
.then((connectionRecord) => this.emitWithConnection(outOfBandRecord, connectionRecord, messages))
.catch((error) => {
if (error instanceof EmptyError) {
this.logger.warn(
`Agent unsubscribed before connection got into ${DidExchangeState.Completed} state`,
error
)
} else {
this.logger.error('Promise waiting for the connection to be complete failed.', error)
}
})
}
}
This approach works fine in online cases where a mobile DIDComm agent scans a QR code and the user is actively waiting until the flow completes. But if network instabilities are found or if we want to enable P2P interactions I think it could be a bit more difficult to achieve.
An idea could be to emit this AgentMessageReceived event when the connection state is transitioned to DidExchangeState.Completed (we can find the messages by querying its associated OOB record) . This way we can safely allow these flows to execute asynchronously.
The text was updated successfully, but these errors were encountered:
The discussion in #2159 made me think that probably we can change the way we process
requests
(messages) in Out of Band invitations (e.g. flows involving proofs requests and credential issuance).Currently,
OutOfBandApi
is doing, in itsacceptInvitation
method:This approach works fine in online cases where a mobile DIDComm agent scans a QR code and the user is actively waiting until the flow completes. But if network instabilities are found or if we want to enable P2P interactions I think it could be a bit more difficult to achieve.
An idea could be to emit this
AgentMessageReceived
event when the connection state is transitioned toDidExchangeState.Completed
(we can find themessages
by querying its associated OOB record) . This way we can safely allow these flows to execute asynchronously.The text was updated successfully, but these errors were encountered: