What the session does when a send does not land.
Three recoveries live here, in the order the server pushes the session through them:
- resend — the payload of every outgoing message is remembered briefly so it can be sent again without asking the caller to rebuild it
- repair — a rejected send usually means the peer's Signal session is stale, so it is dropped and renegotiated before the resend goes out
- placeholder — when a message arrives that this device cannot decrypt at all, the primary device is asked to send it again
Retries run in worker processes started from here; like everything else called by the session, this code runs inside the session process, so those workers are started by it and report back to its mailbox.
A rejection is only reported to the caller once no recovery is left: reporting early would surface an error for a message that is about to be resent successfully.
Summary
Functions
@spec repair_session_and_retry(map(), String.t(), String.t(), ExWapp.Error.Ack.t()) :: map()
@spec repair_session_and_retry( ExWapp.Session.Worker.t(), String.t(), String.t(), ExWapp.Error.Ack.t() ) :: ExWapp.Session.Worker.t()
@spec run_session_repair( map(), String.t(), String.t(), ExWapp.Error.Ack.t(), non_neg_integer(), non_neg_integer() ) :: map()
@spec session_repair_attempts(map(), String.t()) :: non_neg_integer()
@spec session_repair_attempts(ExWapp.Session.Worker.t(), String.t()) :: non_neg_integer()