feat(chat): unread read-receipts with lobby/game dot and history-open ack
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 49s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m16s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 49s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m16s
Persist per-message read state as a chat_messages.unread_seats bitmask
(migration 00008): a text message seeds every recipient seat's bit, a nudge
only the awaited seat's. A seat's bit clears when the player opens the move
history or chat (POST /games/:id/chat/read, sent only when something is
unread), and a nudge additionally clears when its recipient answers by moving
(a wired game NudgeClearer, dependency-inverted so game keeps off social).
UI shows a per-viewer unread dot in the lobby (next to the opponent) and the
game score bar — the unread_chat game-view flag seeds it from authoritative
REST views, live chat/nudge events raise it. Opening the move history counts
as reading (even without entering chat): the 💬 fade-blinks twice and the
client acks. Admin Messages gains an unread-only filter, a read/unread column,
and a per-message card with the per-seat read breakdown. Observability:
chat_read_duration histogram + chat_unread_messages gauge + social tracing.
This commit is contained in:
+19
-3
@@ -514,11 +514,24 @@ disguised robot stays indistinguishable from a person.
|
||||
has a **Messages** section that lists posted messages (nudges excluded)
|
||||
newest-first with the sender's resolved name, **source** (guest / robot / oldest
|
||||
identity kind), IP and game, searchable by sender name / external-id glob masks and
|
||||
pinnable to one game or sender (linked from the game and user cards).
|
||||
pinnable to one game or sender (linked from the game and user cards). It also offers an
|
||||
**unread-only filter** and a read/unread column, and each message has a detail card with
|
||||
the **per-seat read breakdown** (sender / read / unread).
|
||||
- **Nudge**: folded into the chat as a `nudge` message kind. The player awaiting
|
||||
the opponent may nudge **once per hour per game**; it is not allowed on one's own
|
||||
turn. The platform-native delivery runs through the gateway and the platform
|
||||
side-service.
|
||||
- **Read receipts**: each `chat_messages` row carries an `unread_seats` bitmask — a set
|
||||
bit per recipient seat that has **not** yet read it (the sender's own bit is never set).
|
||||
A text message seeds the bits of every seated recipient; a nudge seeds only the awaited
|
||||
player's. A seat's bit clears when that player **opens the move history or the chat**
|
||||
(`POST /games/:id/chat/read`, which the client sends only when it holds unread, so a
|
||||
history open is not a constant backend call), and a **nudge additionally clears when its
|
||||
recipient answers by moving** (the move path calls a wired `NudgeClearer`). The mask is
|
||||
inverted so "anything unread" is a plain `unread_seats <> 0`, which the per-viewer
|
||||
`unread_chat` game-view flag (seeding the lobby and in-game unread **dot**), the admin
|
||||
unread filter and the unread gauge all use. On each clear the publish-to-read latency is
|
||||
recorded; the read time itself is not retained.
|
||||
- **Profile**: `preferred_language` (en/ru, edited in Settings), display name, email
|
||||
(confirm-code binding, see §4), **timezone**, the daily **away window** and the
|
||||
block toggles — all editable through `account.UpdateProfile`, which validates them:
|
||||
@@ -551,7 +564,8 @@ disguised robot stays indistinguishable from a person.
|
||||
`game_moves` (the move journal), `complaints` and `account_stats`, and the
|
||||
social/lobby tables `friendships` (the request/accept graph, its status admitting
|
||||
`declined`), `blocks`
|
||||
(per-user blocks), `chat_messages` (per-game chat and nudges), `email_confirmations`
|
||||
(per-user blocks), `chat_messages` (per-game chat and nudges, carrying the per-message
|
||||
`unread_seats` read bitmask), `email_confirmations`
|
||||
(pending confirm-codes), `game_invitations` / `game_invitation_invitees`
|
||||
(friend-game invitations), `friend_codes` (one-time add-a-friend codes),
|
||||
`game_drafts` (a player's in-progress rack order + board composition per
|
||||
@@ -743,7 +757,9 @@ edits take effect on the next `profile.get` (open/reconnect/foreground), not mid
|
||||
whose synthetic timing dominates the tail, so per-human analysis lives in the admin
|
||||
console, below); counters `games_started_total`, `games_abandoned_total` (a
|
||||
turn-timeout seat drop), `chat_messages_total` (`kind` = message/nudge) and
|
||||
`robot_games_finished_total`; an observable gauge `game_cache_active`; the gateway
|
||||
`robot_games_finished_total`; a histogram `chat_read_duration` (chat publish-to-read
|
||||
latency by `kind`); observable gauges `game_cache_active` and `chat_unread_messages`
|
||||
(chat entries with `unread_seats <> 0`); the gateway
|
||||
`edge_request_duration` (the UI-perceived roundtrip, by `message_type`/`result`);
|
||||
and Go runtime/heap metrics. Game-scoped metrics carry a `variant` attribute
|
||||
(scrabble_en/scrabble_ru/erudit_ru).
|
||||
|
||||
+5
-2
@@ -191,8 +191,11 @@ is awaited at most once per hour (the
|
||||
nudge is part of the game chat); both the in-app toast and the out-of-app push (delivered
|
||||
via the platform) **name the nudger** ("<opponent>: waiting for your move").
|
||||
Chat and the word-check tool share one **comms screen** with **💬 chat** / **🔎 dictionary**
|
||||
tabs, reached from the 💬 in the move-history header (with a back to the game); a new chat
|
||||
message raises an **unread badge** on the game's score bar and the 💬 until the chat is opened.
|
||||
tabs, reached from the 💬 in the move-history header (with a back to the game). An unread chat
|
||||
entry — a message **or a nudge** from an opponent — raises a small **red dot** next to the game
|
||||
in the **lobby** and on the game's **score bar**. Opening the **move history** counts as reading
|
||||
the chat, even without entering it: the dot clears and the 💬 icon **fade-blinks twice**. A nudge
|
||||
also clears the moment its recipient **takes their move**.
|
||||
|
||||
### Profile & settings
|
||||
Edit the display name (letters joined by a single space / "." / "_" separator, with an
|
||||
|
||||
@@ -196,8 +196,11 @@ nudge) приходят от бота **этой партии** — по язы
|
||||
и внеприложенческий push (доставляется через платформу) **называют отправителя**
|
||||
(«<соперник>: жду вашего хода»).
|
||||
Чат и инструмент проверки слова — один **экран связи** со вкладками **💬 чат** / **🔎 словарь**,
|
||||
открываемый по 💬 в шапке истории ходов (с кнопкой «назад» в партию); новое сообщение рисует
|
||||
**бейдж непрочитанного** на строке счёта партии и на 💬 до открытия чата.
|
||||
открываемый по 💬 в шапке истории ходов (с кнопкой «назад» в партию). Непрочитанная запись чата —
|
||||
сообщение **или nudge** от соперника — зажигает маленькую **красную точку** рядом с партией в
|
||||
**лобби** и на **строке счёта** партии. Открытие **истории ходов** считается прочтением чата, даже
|
||||
без захода в него: точка гаснет, а значок 💬 **дважды мигает**. Nudge также гаснет в момент, когда
|
||||
его получатель **делает ход**.
|
||||
|
||||
### Профиль и настройки
|
||||
Редактирование отображаемого имени (буквы, разделённые одиночным пробелом / «.» /
|
||||
|
||||
Reference in New Issue
Block a user