credo-ts icon indicating copy to clipboard operation
credo-ts copied to clipboard

Send messages can be stuck in a mediator

Open jleach opened this issue 2 years ago • 0 comments

I'm documenting this issue with video and sample code here. This TL;DR version of the issue is that message can become stuck in an ACA-py mediator under certain circumstances. The mediator does not re-try sending the message and they are only picked up by AFJ if initiateMessagePickup() is called when the connection enters the "completed" state.

I don't think this is a problem with AFJ per-se but rather a know side effect of short comings in the V1 protocol. This requires agents to follow a convention rather than a rule. I'm creating this issue to determine if there is a better way for Bifold to re-trigger message delivery than waiting for a connection to become "completed" and calling the above mentioned API. This is how its currently being fixed.

Have an issue in ACA-py similar to this one to see if there is a way to get message stuck in the queue to be re-tried. Here is a sample of the Bifold fix:

  useEffect(() => {
    // FIX:(jl) There may be a better way to fetch queued messages.
    // Under investigation.
    if (connection && connection.state === DidExchangeState.Completed) {
      agent?.mediationRecipient.initiateMessagePickup()
    }
  }, [connection])

jleach avatar Feb 03 '23 20:02 jleach