# Messaging

### TB-021 — Real-time in-app chat between owner and walker

- **Size:** L
- **Hours:** 23
- **Scope:** Full

Real-time in-app chat between owner and walker

Size reason: L — a websocket transport with delivery guarantees and reconnect handling is a system of its own.

**Acceptance criteria**

- Messages between owner and walker appear in real time without a page refresh
- Chat recovers and redelivers correctly after a network drop and reconnect
- Message history persists and reloads correctly on reopening the chat
- Chat is scoped strictly to the relevant booking/relationship with no cross-user leakage
- Delivery/sent status is shown accurately

### TB-022 — Push and email notifications for bookings and messages

- **Size:** M
- **Hours:** 11
- **Scope:** MVP

Push and email notifications for bookings and messages

Size reason: M — several notification types across two channels must stay in sync with booking and message state.

**Acceptance criteria**

- Booking status changes trigger the correct push and/or email notification
- A new chat message triggers a notification only when the recipient isn't actively viewing the chat
- Respected notification preferences suppress opted-out channels
- Notifications stay in sync with actual state with no stale or duplicate sends

### TB-023 — Unread message counts and read receipts

- **Size:** S
- **Hours:** 5
- **Scope:** Full

Unread message counts and read receipts

Size reason: S — a small derived-state feature layered on top of the messaging model above.

**Acceptance criteria**

- Unread count increments when a new message arrives and hasn't been viewed
- Opening a conversation marks its messages read and clears the unread count
- Read receipt indicator updates for the sender once the message is read
- Unread counts stay accurate across multiple simultaneous conversations