> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloak.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Known limitations

> The honest list. What is broken, what is deliberately absent, and what will not be built. Check here before you spend an evening debugging.

This page exists so you stop debugging things that are not your fault. Each item says what happens, why, and whether it is expected to change.

## Broken today

### `fetchMembers()` hangs

> [!WARNING]
>
> `fetchMembers()` and `guild().fetchMembers()` are **broken against every current backend**. The server never answers, so the promise sits for the transport's 8 second reply timeout and then rejects with a plain `Error` ("Timed out waiting for opcode 30"). No roster ever comes back.

A backend change made the underlying opcode direct-message-only, so a server-scoped request produces **no reply frame of any kind**, not even an error code. This is not flakiness and it is not a permission problem. It affects every bot on every server.

The practical consequence: a command that enumerates members stalls its handler for 8 seconds and then fails. Enumeration is planned as a new opcode behind a new permission, and the signature will survive that.

```ts theme={null}
// Do not do this. It waits 8 seconds and rejects.
const members = await client.guild(serverId).fetchMembers();
```

For a name lookup, use `searchMembers(serverId, query)` instead. It works today: a case-insensitive prefix match over username, display name, and nickname, at most 25 hits, offline members included. See [Search members by name](https://docs.cloak.chat/guides/members-and-roles.md#search-members-by-name).

`fetchRoles()` is unaffected and works normally. So does everything else in the read surface.

The rebuild is planned and the signature will survive it, so code written against `fetchMembers()` stays valid. It just cannot run today.

## Not exposed to bots

### Direct message pins, and what needs wire version 3

A bot can hold a 1:1 end-to-end encrypted DM with a human, and both directions work. What does not work inside a DM, and what needs a backend that honors wire version 3:

| Call | Behavior in a DM |
| - | - |
| `msg.pin()` / `unpin()` | Rejects. The pin operation has no DM lane a bot can observe. |
| `sendCommand()` | Server channels only. |
| `sendTyping()` | Server channels, threads, and posts only. A DM takes `sendTypingDM(userId)`. |
| `msg.react()` / `unreact()`, `edit()`, `editCard()`, `delete()` | Work on a backend that honors wire version 3. On an older backend a DM message carries no `createdAt` and they reject with a message saying so. |
| `fetchDmMessages()`, `fetchMessages(null, dmId)` | Work on a backend that honors wire version 3. Resolve empty on an older one. |
| Slash commands from the DM `/` picker | Dispatch on a backend that honors wire version 3. A typed `/command` dispatches on any backend. |
| `msg.repliedTo`, `msg.card`, `msg.createdAt` | Populated on a backend that honors wire version 3. `null` on an older backend. |

`reply()` and `channel.send()` work everywhere, and `messageCreate` still fires. See [What a wire version 3 backend adds](https://docs.cloak.chat/guides/direct-messages.md#what-a-wire-version-3-backend-adds).

### Group DMs

Not implemented. The group-DM lane has a different, versioned key model. 1:1 DMs are the whole DM surface today.

### The REST lane is off by default

`client.rest` is disabled server-side. The first call rejects with a message saying the flag is unset. When an operator does enable it, the credential is scoped behind a default-deny allowlist that denies the custom-emoji and audit-log reads, which is why the SDK ships no `fetchCustomEmojis()` and no `fetchAuditLog()`. See [What the server must support](https://docs.cloak.chat/production/backend-requirements.md).

### The `typing` event has no channel

`serverId` and `channelId` on the `typing` event are always `null`. This is a wire fact, not a decode gap: the relay frame carries no routing tail, and the source channel travels in the server's internal fanout envelope, which never reaches the client.

> [!WARNING]
>
> Do not substitute the bot's own selection cursor. It points wherever the bot last sent, which has nothing to do with who is typing. **A bot cannot currently tell which channel a typing event came from.**

A plan-136 backend appends routing to the relay, and the SDK then fills `serverId`, `channelId`, `containerKind`, and `parentChannelId`; check `capabilities()?.typingRouting`. Outbound typing is not limited either way. `sendTyping()` reaches threads and forum posts through its `target` argument and `sendTypingDM()` reaches a DM. See [Typing, presence, and profile](https://docs.cloak.chat/guides/typing-presence-and-profile.md#type-in-a-thread-a-post-or-a-dm).

### A click in a thread or post may arrive without its container after a restart

On an older backend, `Interaction.threadId` and `Interaction.postId` are filled from an index the SDK builds while it runs, seeded by thread and post events, container frames, and history reads, and the click frame itself carries only the child channel id. After a cold start, a button pressed on a card in a thread or post the SDK has not yet seen arrives with `channelId` equal to the container and both container fields `null`. A plan-136 backend closes this: the push, every thread frame, and every hook carry the container kind and parent (`Interaction.parentChannelId`, `Message.threadParentId`), and `resolveContainer()` turns any child id into its parent on demand. Check `capabilities()?.containerParents`.

### A delivery outcome is knowable only with a receipt

`send()` and the other send-shaped calls resolve when the frame is out. Pass `ack: true` to wait for the server's echo of the message instead, which is what proves it was persisted. Without it, silence is not delivery. `sendFile()` and `sendFiles()` take the same option; their upload and grant legs are always awaited and reject on failure, but the final message send is fire-and-forget unless you ask for the receipt. See [Sending is fire-and-forget unless you ask for a receipt](https://docs.cloak.chat/concepts/message-delivery.md#sending-is-fire-and-forget-unless-you-ask-for-a-receipt).

The fields are typed nullable so that a future backend appending routing is an additive change rather than a breaking one.

## Voice

### Bots cannot publish video, and will not

A bot never gets a subscription tier, and the backend restricts a bot's publish sources to microphone at token-mint time. Camera and screenshare are denied at the credential, not by the SDK, so there is no path to enable and nothing to configure.

### `p2pWebcam` and `p2pStream` are dead

> [!WARNING]
>
> `VoiceParticipant.p2pWebcam` and `VoiceParticipant.p2pStream` still exist on the type, but peer-to-peer video was removed from the platform. The server no longer sends those columns, so both fields are permanently `false`. Do not branch on them, and never present peer-to-peer video as a feature.

They remain on the type for compatibility with code written before the removal.

### Server voice is microphone-clamped until the bot reports its connection

A current Cloak backend mints a server-voice credential with the microphone withheld and admits it only after the bot reports its media connection up. `VoiceMediaSession.attach()` sends that report through `VoiceMediaOptions.connectionReporter` before it publishes and waits for the admission, up to `admissionTimeoutMs` (default 5 s). A session attached **without** `connectionReporter: client.voiceConnectionReporter()` skips the wait and publishes into a void: the publish succeeds locally, the SFU forwards nothing, and nothing reports it beyond a warning under `debug`. An older single-phase backend is unaffected, which is why a bot that worked there goes silent after a backend upgrade. Pass the reporter on every attach. See [Microphone admission](https://docs.cloak.chat/voice/audio.md#microphone-admission).

### A bot cannot detect a voice encryption failure

The voice media engine surfaces **no per-participant end-to-end encryption failure state**. The generic encryption-error event carries no identity, missing-key and decryption-failed conditions are dropped, and a keyless frame decryptor retries quietly forever. The one per-participant event that exists reports that frames are *marked* encrypted and stays true through the exact key and identity mismatch cases you would want it to catch.

So **a bot cannot detect that nobody can decrypt it**, and a listening bot cannot detect that it is failing to decrypt someone. Silence is the only symptom, and nothing reports it.

Because of that, the SDK ships **no** voice health check and **no** retry-on-decrypt-failure path. Both would be theatre. The defence is to be right by construction: `attach()` installs exactly the key material the key manager returns, under the identity the engine reported, before publishing, and fails closed on every precondition. If members hear silence, suspect the key or the identity rather than the network.

Related: a bot without `voice_listen` holds only its own frame key and is cryptographically unable to decrypt any member. A bot **granted** `voice_listen` can decrypt everyone in the channel, by design. Never quote the first sentence without the second. Also, a `voice_listen` bot must join **non-deafened**, because subscription is baked into the join credential.

## Encryption boundaries

Message bodies are end-to-end encrypted. Two deliberate exceptions are worth knowing before you design around "the server cannot read anything".

### Mention targets ride in plaintext

A Cloak mention is two independent things: pill text inside the encrypted body, and a plaintext `[id, isRole]` pair in the send frame. The server has to read the second one to fan out notifications without decrypting the first.

> [!WARNING]
>
> Anyone with server-side visibility can see **who** your bot pinged, just not **what** it said. This is Cloak's design, not an SDK leak, and moving the pairs into the ciphertext would simply stop notifications from being delivered.

### The webhook embed lane is not encrypted at all

`sendEmbed()` and `postToWebhook()` post over a lane that is stored as **plaintext** server-side and renders under a **webhook identity**, not your bot's. The payload type is named `UnencryptedWebhookPost` on purpose, and `unencrypted: true` is required and enforced at runtime.

Use `sendCard()` when you want a rich card that stays encrypted and posts as the bot. See [Choosing an embed lane](https://docs.cloak.chat/guides/rich-cards.md).

## Rich cards

### Media must be Cloak-hosted

The four slots a card fetches with no user action, `image.url`, `thumbnail.url`, `author.icon_url` and `footer.icon_url`, must have origin exactly `https://media.cloak.chat`. Anything else throws a `CloakEmbedError` locally, before a frame leaves the process.

Rendering a card fetches its media, which reveals the **viewer's IP address** to whoever hosts the URL. On this lane that URL is chosen by a third-party bot author who could also serve different bytes to different viewers, with no new message for moderation to see. The server cannot rewrite anything here, because it cannot read the payload.

There is deliberately **no option, environment variable or flag** that widens the allowed origin. The link slots (`url`, `author.url`, `provider.url`) are unrestricted, because nothing is fetched for them at render.

Where a Cloak-hosted URL comes from today: an asset a human uploaded through the Cloak app, your bot's own avatar, or a room icon. [File attachments](https://docs.cloak.chat/guides/file-attachments.md) do not produce card media: `sendFile()` uploads end-to-end encrypted blobs, not publicly fetchable media on that origin.

### `fields` and older mobile builds

> [!WARNING]
>
> Card `fields` render on desktop and mobile from the client release that ships with SDK 0.4.0. A mobile build **older than that** drops the rows silently, with no error anywhere. Until your server's members have updated, keep anything a reader must actually see in `description` and treat `fields` as decoration. The same release is the one that renders component rows, so a member who sees your buttons also sees your fields.

Three keys that exist on the webhook lane and do not exist on the card lane: `video` (removed entirely, passing it throws), `provider.icon`, and unknown keys (rejected rather than silently dropped, because the renderer would drop them while they still counted against the payload budget).

## Slash commands, v1

Two properties you have to design around rather than work around.

> [accordion] There is no ephemerality
>
> An invocation is a normal message encrypted with the channel's key. **Every member holding that key can read every invocation**, and it is a durable message row. There is no "only you can see this". Ephemeral responses need a different key lane and are a later version. Do not fake them by deleting the message afterwards.

> [accordion] The registry menu is plaintext server-side
>
> Command names, descriptions, option names and choice labels are stored and served **unencrypted**, so that a client's picker can render them without holding a key. Never put a secret, an internal hostname, or a customer name in a command description or a choice label.

Two more mechanics worth knowing: register commands **before** `login()`, because that is when the menu is published and the SDK does not re-publish on its own, and commands do dispatch from DMs: a typed `/command` on any backend, the DM picker's structured form on a backend that honors wire version 3. Declare `dm: false` on a command that must stay out of DMs. See [Commands in direct messages](https://docs.cloak.chat/guides/slash-commands.md#commands-in-direct-messages).

## Things that are easy to misread as bugs

| Behavior | It is working as designed |
| - | - |
| `send()` resolves, then nothing appears | Sends are fire-and-forget by default. A denial arrives on the `sendRejected` event, not as a rejected promise. Pass `ack: true` to get a promise that resolves with the persisted message or rejects with the denial. |
| A handler threw and nothing was logged | Attach an `error` listener. Without one, caught failures stay silent by design. |
| An embed posted fine but has no images | A server-side image-proxy setting. See [What the server must support](https://docs.cloak.chat/production/backend-requirements.md). |
| The bot disconnected once and never retried | A terminal login rejection, `-2` or `-12`. Retrying cannot fix either. |
| Events for a server the bot has not selected do not arrive | Requires a backend with membership-routed hooks. |
| A thread history read rejects instead of returning rows | The server answered with the parent channel's messages, which means the backend does not support thread history. Handing those back as the thread's would be worse. See [What the server must support](https://docs.cloak.chat/production/backend-requirements.md). |
| `WebTransport` fails on your PaaS image | That lane needs glibc 2.38 or newer. The default `wss://` lane needs nothing. |

## Next

> [card] [When a bot will not start](https://docs.cloak.chat/production/troubleshooting.md)
>
> Symptom-indexed triage for the failures you can see.

> [card] [What the server must support](https://docs.cloak.chat/production/backend-requirements.md)
>
> The server-side half of this list.

> [card] [Deploying a bot](https://docs.cloak.chat/production/deploying.md)
>
> Getting a bot onto a host without tripping over the keystore.

> [card] [Changelog and migration](https://docs.cloak.chat/changelog.md)
>
> What changed in 0.2.0, including the breaking changes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.