Commit 089f467
committed
feat(room-worker): actor-named, count-based membership system messages
Make create-channel / add-members / remove-member system messages
actor-named and count-based so the frontend can render clickable lists of
who was added/removed:
- members_added (add + create): "Alice added 2 people and 1 organization to
the chatroom", with a single shared addedContent helper used by both flows;
a lone individual (no orgs) still renders the named form. Payload lists are
the resolved member set — req.Users for add, req.ResolvedUsers for create
(channel-expanded individuals included, org members represented as orgs).
An empty channel emits no members_added (room_created still fires).
- member_removed / member_left: actor-named removals
("Alice removed Bob from the chatroom"); wording "channel" -> "chatroom"
across all membership messages.
- Empty individuals/orgs lists marshal as [] (not null) for the frontend.
- docs/client-api.md: document the members_added / member_removed /
member_left sysMsgData payload schema.
- history-service: integration test asserting sysMsgData survives the
load-history round-trip.
No pkg/model struct changes, no room-service/materialization changes, and no
new database reads.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WuJMTQH2mnUqKd6jhSg8HK1 parent ad6f8fc commit 089f467
9 files changed
Lines changed: 476 additions & 81 deletions
File tree
- docs
- history-service/internal/cassrepo
- pkg/model
- room-service
- room-worker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2325 | 2325 | | |
2326 | 2326 | | |
2327 | 2327 | | |
2328 | | - | |
| 2328 | + | |
2329 | 2329 | | |
2330 | 2330 | | |
2331 | 2331 | | |
2332 | 2332 | | |
2333 | 2333 | | |
2334 | 2334 | | |
2335 | 2335 | | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
2336 | 2382 | | |
2337 | 2383 | | |
2338 | 2384 | | |
| |||
4706 | 4752 | | |
4707 | 4753 | | |
4708 | 4754 | | |
4709 | | - | |
| 4755 | + | |
4710 | 4756 | | |
4711 | 4757 | | |
4712 | 4758 | | |
| |||
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
335 | 337 | | |
336 | 338 | | |
337 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
| 303 | + | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
| 456 | + | |
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
| 659 | + | |
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| |||
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
1066 | | - | |
1067 | | - | |
| 1066 | + | |
| 1067 | + | |
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
| |||
1107 | 1107 | | |
1108 | 1108 | | |
1109 | 1109 | | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1110 | 1113 | | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1114 | 1117 | | |
1115 | 1118 | | |
1116 | 1119 | | |
1117 | 1120 | | |
1118 | 1121 | | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1125 | 1128 | | |
1126 | 1129 | | |
1127 | 1130 | | |
| |||
1524 | 1527 | | |
1525 | 1528 | | |
1526 | 1529 | | |
1527 | | - | |
| 1530 | + | |
1528 | 1531 | | |
1529 | 1532 | | |
1530 | 1533 | | |
| |||
1610 | 1613 | | |
1611 | 1614 | | |
1612 | 1615 | | |
1613 | | - | |
| 1616 | + | |
1614 | 1617 | | |
1615 | 1618 | | |
1616 | 1619 | | |
| |||
1637 | 1640 | | |
1638 | 1641 | | |
1639 | 1642 | | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
1640 | 1650 | | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
1644 | 1654 | | |
1645 | 1655 | | |
1646 | 1656 | | |
1647 | 1657 | | |
1648 | 1658 | | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
1649 | 1662 | | |
1650 | 1663 | | |
1651 | 1664 | | |
1652 | 1665 | | |
1653 | 1666 | | |
1654 | 1667 | | |
1655 | | - | |
| 1668 | + | |
1656 | 1669 | | |
1657 | 1670 | | |
1658 | 1671 | | |
| |||
0 commit comments