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

Chat and contact commands that reach the server through app-state sync.

Each command picks the patch that describes the change and hands it to the
session, then reports success as `:ok` instead of leaking the hash state the
transport returns.

This is orchestration, not actor work: nothing here touches the session
process state, which is why it lives outside `ExWapp.Session.Worker`.

# `result`

```elixir
@type result() :: :ok | {:error, term()}
```

# `archive_chat`

```elixir
@spec archive_chat(GenServer.server(), String.t()) :: result()
```

Archives a chat, synchronising the change to the other devices.

# `create_contact`

```elixir
@spec create_contact(GenServer.server(), String.t(), String.t()) :: result()
```

Creates or updates a contact, synchronising the change to the other devices.

# `delete_chat`

```elixir
@spec delete_chat(GenServer.server(), String.t()) :: result()
```

Deletes a chat, synchronising the change to the other devices.

# `delete_contact`

```elixir
@spec delete_contact(GenServer.server(), String.t()) :: result()
```

Deletes a contact, synchronising the change to the other devices.

# `unarchive_chat`

```elixir
@spec unarchive_chat(GenServer.server(), String.t()) :: result()
```

Unarchives a chat, synchronising the change to the other devices.

---

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