# Send and receive a message

**Flow key:** `messaging`

## Outcome

An authorized sender delivers one preserved message to the intended conversation and recipients, with truthful ordering, delivery state, notifications, and moderation.

## Actors

- Sender
- Recipient(s)
- Messaging service
- Notification/moderation systems

## Preconditions and entry points

- A synthetic conversation exists with authorized and unauthorized users.
- Retention, edits, deletion, receipts, attachments, and moderation policies are known.

## Required test data

Use synthetic, isolated, resettable data. Never use real credentials, payment instruments, private customer records, or production notifications.

| Data | Canonical valid seed | Critical variations |
|---|---|---|
| Conversation | `CARBON-CHAT-001` | direct, group, archived, other tenant, recipient removed |
| Message | `Hello CARBON :) 👩‍💻` | empty, multiline, kaomoji, RTL, long, markup/link canary |
| Attachment | small safe text file | none, image, rejected type, upload still pending |
| Network | normal | offline queue, slow, reconnect, response lost |
| Recipients | active member | muted, blocked, suspended, no access |

## Canonical steps

Treat this as the ordinary successful path inferred from common product behavior. Adapt it to observed labels, business rules, APIs, and implementation evidence; do not invent a requirement.

| Step | User or system action | Expected evidence |
|---:|---|---|
| 1 | Open the intended conversation. | Participants, history, privacy, and compose availability are accurate. |
| 2 | Enter text and optional attachment/mention. | Preview preserves content and exposes the intended audience. |
| 3 | Send once. | One locally pending message obtains one stable server identity. |
| 4 | Observe sender and recipient views. | Content, order, time, delivery/read state, and access agree. |
| 5 | Edit/delete/react/reply if supported. | History, permissions, notifications, and references follow policy. |
| 6 | Disconnect/reconnect and retry. | Offline/outbox reconciliation prevents duplicates and lost committed messages. |

## Alternate paths

- Direct/group message
- Reply/thread
- Attachment
- Offline send
- Edit/delete/react

## Failure and recovery paths

- Duplicate send on retry
- Recipient removed mid-send
- Out-of-order events
- Attachment scan fails
- Notification leaks private content

## Completion oracle

- The stated outcome is true in visible UI and authoritative persisted state.
- Exactly one intended business result and no unintended side effect occurred.
- Identity, tenant, authorization, money/data, lifecycle, notifications, integrations, analytics, and audit agree where applicable.
- Refresh, retry, back/forward, and a second authorized read do not reveal a contradictory result.
- Any partial, delayed, canceled, failed, or unknown outcome is labeled truthfully and has a safe recovery path.

## Evidence to capture

- Entry context, actor, tenant, role, feature flags, locale, time zone, and initial identifiers/state.
- Step-level screenshots or DOM state plus request/response, correlation, job, event, and stable business IDs where available.
- Before/after authoritative records, versions, totals, permissions, lifecycle states, and downstream side effects.
- Notifications, audit events, integration deliveries, retries, deduplication, latency, and recovery evidence.
- Untested branches, unsafe-to-run cases, product decisions, and evidence tier.

## Product decisions to resolve

- Exact eligibility, required data, authorization, and validation rules.
- Which steps are synchronous, asynchronous, optional, skippable, reversible, or irreversible.
- Idempotency, concurrency, timeout, retry, cancellation, and compensation semantics.
- Retention, privacy, notification, audit, performance, accessibility, and localization commitments.

## Related CARBON items

- [in app message chat feed item](../../items/content/in-app-message-chat-feed-item.md)
- [upload and file input](../../items/content/upload-and-file-input.md)
- [notification and reminder](../../items/content/notification-and-reminder.md)
- [privacy](../../items/quality/privacy.md)

[Back to Engagement and support flows](index.md)
