Commit adb60ed
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 b556c24 commit adb60ed
8 files changed
Lines changed: 380 additions & 77 deletions
File tree
- docs
- history-service/internal/cassrepo
- pkg/model
- room-worker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2322 | 2322 | | |
2323 | 2323 | | |
2324 | 2324 | | |
2325 | | - | |
| 2325 | + | |
2326 | 2326 | | |
2327 | 2327 | | |
2328 | 2328 | | |
2329 | 2329 | | |
2330 | 2330 | | |
2331 | 2331 | | |
2332 | 2332 | | |
| 2333 | + | |
| 2334 | + | |
| 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 | + | |
2333 | 2381 | | |
2334 | 2382 | | |
2335 | 2383 | | |
| |||
4683 | 4731 | | |
4684 | 4732 | | |
4685 | 4733 | | |
4686 | | - | |
| 4734 | + | |
4687 | 4735 | | |
4688 | 4736 | | |
4689 | 4737 | | |
| |||
Lines changed: 70 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 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 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 | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | | - | |
| 452 | + | |
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
| 655 | + | |
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | | - | |
1046 | | - | |
| 1045 | + | |
| 1046 | + | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
| 1089 | + | |
| 1090 | + | |
1089 | 1091 | | |
1090 | | - | |
1091 | | - | |
| 1092 | + | |
| 1093 | + | |
1092 | 1094 | | |
1093 | 1095 | | |
1094 | 1096 | | |
1095 | 1097 | | |
1096 | 1098 | | |
1097 | 1099 | | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1104 | 1106 | | |
1105 | 1107 | | |
1106 | 1108 | | |
| |||
1503 | 1505 | | |
1504 | 1506 | | |
1505 | 1507 | | |
1506 | | - | |
| 1508 | + | |
1507 | 1509 | | |
1508 | 1510 | | |
1509 | 1511 | | |
| |||
1589 | 1591 | | |
1590 | 1592 | | |
1591 | 1593 | | |
1592 | | - | |
| 1594 | + | |
1593 | 1595 | | |
1594 | 1596 | | |
1595 | 1597 | | |
| |||
1616 | 1618 | | |
1617 | 1619 | | |
1618 | 1620 | | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
1619 | 1628 | | |
1620 | | - | |
1621 | | - | |
| 1629 | + | |
| 1630 | + | |
1622 | 1631 | | |
1623 | 1632 | | |
1624 | 1633 | | |
1625 | 1634 | | |
1626 | 1635 | | |
1627 | 1636 | | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
1628 | 1640 | | |
1629 | 1641 | | |
1630 | 1642 | | |
1631 | 1643 | | |
1632 | 1644 | | |
1633 | 1645 | | |
1634 | | - | |
| 1646 | + | |
1635 | 1647 | | |
1636 | 1648 | | |
1637 | 1649 | | |
| |||
0 commit comments