diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-18 23:41:39 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-18 23:41:39 -0400 |
| commit | 17b62b3458e3a992b93cd485b05d3fb112dd349a (patch) | |
| tree | a1d5acc1aecac744f14172d0b9e53675c77be20b /docs/api | |
| parent | d3fbecc57b5d6fa3223b945a45fe21eb78ffd49b (diff) | |
Explain (some of) the rationale for returning "empty" values in tombstone events in the docs.
Diffstat (limited to 'docs/api')
| -rw-r--r-- | docs/api/events.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/api/events.md b/docs/api/events.md index da2f4b6..2f48df1 100644 --- a/docs/api/events.md +++ b/docs/api/events.md @@ -140,7 +140,7 @@ These events have the `event` field set to `"created"`. They include the followi | `name` | string | The channel's name. | | `deleted_at` | timestamp, optional | If set, the moment the channel was deleted. | -When a channel is deleted or expires, the `"created"` event is replaced with a tombstone `"created"` event, so that the original channel cannot be trivially recovered from the event stream. Tombstone events have a `deleted_at` field, and a `name` of `""`. +When a channel is deleted or expires, the `"created"` event is replaced with a tombstone `"created"` event, so that the original channel cannot be trivially recovered from the event stream. Tombstone events have a `deleted_at` field, and a `name` of `""`. Tombstone events for channels use an empty string as the name, and not `null` or with the `name` field removed entirely, to simplify client development. While clients _should_ treat deleted channels specially, for example by rendering them as "channel deleted" markers, they don't have to be - they make sense if interpreted as channels with empty names, too. Once a deleted channel is [purged](./channels-messages.md#expiry-and-purging), these tombstone events are removed from the event stream. @@ -198,7 +198,7 @@ These events have the `event` field set to `"sent"`. They include the following | `body` | string | The text of the message. | | `deleted_at` | timestamp, optional | If set, the moment the message was deleted. | -When a message is deleted or expires, the `"sent"` event is replaced with a tombstone `"sent"` event, so that the original message cannot be trivially recovered from the event stream. Tombstone events have a `deleted_at` field, and a `body` of `""`. +When a message is deleted or expires, the `"sent"` event is replaced with a tombstone `"sent"` event, so that the original message cannot be trivially recovered from the event stream. Tombstone events have a `deleted_at` field, and a `body` of `""`. Tombstone events for messages use an empty string as the `body`, and not `null` or with the `body` field removed entirely, to simplify client development. While clients _should_ treat deleted messages specially, for example by rendering them as "message deleted" markers, they don't have to be - they make sense if interpreted as messages with empty bodies, too. Once a deleted message is [purged](./channels-messages.md#expiry-and-purging), these tombstone events are removed from the event stream. |
