# `ExWapp.Session.Worker.SendRecovery`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/session/worker/send_recovery.ex#L1)

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.

# `do_send_text_worker`

# `maybe_retry_outgoing_message`

# `maybe_start_placeholder_resend_request`

# `normalize_outbound_text`

# `normalize_retry_participant`

# `register_send_worker`

# `remember_outgoing_retry_payload`

# `repair_session_and_retry`

```elixir
@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()
```

# `run_session_repair`

```elixir
@spec run_session_repair(
  map(),
  String.t(),
  String.t(),
  ExWapp.Error.Ack.t(),
  non_neg_integer(),
  non_neg_integer()
) :: map()
```

# `session_repair_attempts`

```elixir
@spec session_repair_attempts(map(), String.t()) :: non_neg_integer()
@spec session_repair_attempts(ExWapp.Session.Worker.t(), String.t()) ::
  non_neg_integer()
```

# `start_send_worker`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
