Fix : channels and rooms subcommands : list and occupancy#191
Fix : channels and rooms subcommands : list and occupancy#191
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the channels and rooms listing + occupancy subcommands to avoid expensive occupancy lookups during listing, and to standardize occupancy output (both human-readable and JSON) across commands.
Changes:
channels list/rooms listnow return only channel/room identifiers (no occupancy), avoiding per-item occupancy retrieval.channels occupancy/rooms occupancyJSON output is refactored to consistently nest results/events under a top-leveloccupancyfield.- Unit tests and README command docs are updated to reflect the new output shapes and behavior.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/commands/rooms/occupancy/subscribe.test.ts | Updates subscribe tests to use Realtime occupancy events and validate occupancy-nested JSON envelopes. |
| test/unit/commands/rooms/occupancy/get.test.ts | Updates get tests to use REST /channels/:id?occupancy=metrics and validate all metrics + occupancy nesting. |
| test/unit/commands/rooms/list.test.ts | Removes occupancy assertions; updates JSON expectations to room-name-only objects and includes total/timestamp/hasMore. |
| test/unit/commands/rooms/features.test.ts | Aligns feature tests with REST/realtime mocks and new subscribe/get behaviors. |
| test/unit/commands/channels/occupancy/subscribe.test.ts | Updates event assertions to expect occupancy.channelName rather than a top-level channel. |
| test/unit/commands/channels/occupancy/get.test.ts | Updates JSON shape assertions to occupancy.channelName + metrics; ensures all 6 metrics appear in text output. |
| test/unit/commands/channels/list.test.ts | Removes occupancy-from-list assertions; updates JSON expectations to channelId-only items and paging metadata. |
| src/commands/rooms/occupancy/subscribe.ts | Refactors room occupancy subscribe to use Realtime [meta]occupancy on ${room}::$chat and nest JSON under occupancy. |
| src/commands/rooms/occupancy/get.ts | Refactors room occupancy get to use REST channel details + occupancy metrics and nest JSON under occupancy. |
| src/commands/rooms/list.ts | Removes occupancy printing and returns only room names (and paging metadata) in both text and JSON output. |
| src/commands/channels/occupancy/subscribe.ts | Nests JSON events under occupancy and prints structured metrics fields in text output. |
| src/commands/channels/occupancy/get.ts | Nests JSON results under occupancy and prints all 6 metrics in text output. |
| src/commands/channels/list.ts | Removes occupancy printing and returns only channel IDs (and paging metadata) in both text and JSON output. |
| README.md | Updates generated command docs/examples to reflect flag changes and updated descriptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1. list -> now only returns names of channels and rooms without occupancy 2. occupancy -> refactored to show all fields for json/non-json flags
9d92ed8 to
3072af4
Compare
d04f99b to
9b22697
Compare
9b22697 to
21a8155
Compare
- Refactored channels list and rooms list commands to return plain names
21a8155 to
3b1dffc
Compare
WalkthroughThis PR refactors the Changes
Review Notes
|
channels list/rooms list-> now only returns names of channels and rooms without occupancy. Avoids retrieving occupancy for every listed channel. We already have separate subcommandschannels occupancy getandrooms occupancy getto retrieve occupancy.channels occupancy/rooms occupancy-> refactored to show all fields for json/non-json flags