Skip to content

feat(room-service): add app.tabs and app.cmd-menu RPCs#238

Merged
mliu33 merged 1 commit into
mainfrom
claude/determined-fermi-A07HN
Jun 3, 2026
Merged

feat(room-service): add app.tabs and app.cmd-menu RPCs#238
mliu33 merged 1 commit into
mainfrom
claude/determined-fermi-A07HN

Conversation

@vjauhari-work
Copy link
Copy Markdown
Collaborator

@vjauhari-work vjauhari-work commented May 28, 2026

Summary

Two new read-only NATS request/reply RPCs in room-service, gated by room membership OR platform-admin role:

  • GetRoomAppTabschat.user.{account}.request.room.{roomID}.{siteID}.app.tabs — returns apps whose channelTab.enabled AND channelTab.default are both true, each with a per-room tabUrl produced by substituting ${roomId} / ${siteId} into the app's URL template and merging it with the configured SITE_URL (scheme + host + path-prefix preserved, template userinfo stripped).
  • GetRoomAppCommandMenuchat.user.{account}.request.room.{roomID}.{siteID}.app.cmd-menu — for every bot subscribed to the room (u.isBot=true), returns the bot's active bot_cmd_menu blocks joined with the owning app's name.

What's in the PR

New types in pkg/modelUser.Roles + IsPlatformAdmin + PlatformRoleAdmin; IsRoomMember; App.AvatarURL; App.ChannelTab (+ AppChannelTab, AppChannelTabURL); BotCmdMenu + CmdBlock + CmdModal; wire wrappers RoomApp, GetRoomAppTabsResponse, RoomAppAssistant, GetRoomAppCommandMenuResponse; MaxCmdBlockDepth=10 + ValidateCmdBlockDepth guard.

New subject builders in pkg/subjectRoomAppTabs + wildcard, RoomAppCmdMenu + wildcard. ParseUserRoomSubject tightened to reject empty/wildcard account and roomID tokens.

room-service — three new RoomStore methods (ListDefaultChannelTabApps, ListRoomBotApps aggregation, ListActiveCmdMenus); three new compound indexes (apps, subscriptions, bot_cmd_menu); shared authorizeRoomAppRead helper; marshalBounded / replyBoundedJSON sourced from nc.MaxPayload() so oversize replies fail with a clean errResponseTooLarge rather than a silent NATS drop; URL rewrite in buildTabURL with RFC3986-unreserved input validation; SITE_URL env var (required, validated at startup).

Docsdocs/client-api.md gets two new entries per CLAUDE.md §5; room-service/deploy/docker-compose.yml gets SITE_URL=http://localhost:3000 for local dev. Design spec at docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md; implementation plan at docs/superpowers/plans/2026-05-26-room-service-app-tabs-and-cmd-menu.md.

Test Plan

  • make test — green
  • make test SERVICE=pkg/model, make test SERVICE=pkg/subject, make test SERVICE=room-service — green
  • make lint — 0 issues
  • make test-integration SERVICE=room-service — green against real Mongo 8.2.9 (verified locally with Docker+VFS, 21s for the 7 new test functions)
  • CI re-runs all of the above
  • Manual smoke against staging — verify the two new subjects respond with the expected shape; verify SITE_URL ingress path-prefix is preserved

Coverage of new symbols (unit)

Symbol Coverage
handleGetRoomAppTabs 95.8%
handleGetRoomAppCommandMenu 93.1%
authorizeRoomAppRead 100%
buildTabURL 100%
marshalBounded 100%
IsPlatformAdmin / IsRoomMember / ValidateCmdBlockDepth 100%
ListDefaultChannelTabApps / ListRoomBotApps / ListActiveCmdMenus 0% (covered by integration tests)

Migrations / ops

  • SITE_URL env var is required on room-service. Set in every deployment (http(s)://host[/path-prefix]).
  • User.Roles is absent on legacy user documents — decodes to nil, IsPlatformAdmin returns false. Real platform admins lose access until ops backfills via updateMany.
  • Subscription.User.IsBot (PR Fix: Added 'isBot' field in SubscriptionUser #219) — pre-existing bot subs without this field miss the cmd-menu join. Re-subscribes or a one-shot backfill close the gap.
  • bot_cmd_menu collection is new; recommend a partial unique index {name:1} where {activeStatus:true} on the writer side.

Out of scope (deferred)

Cross-site federation; write paths; caching; Prometheus per-handler metrics; auth+data parallelization via errgroup (documented in spec's "Future optimizations").


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Read-only endpoints to list per-room app channel tabs and per-room bot command menus.
  • API Changes

    • Org members subject now includes siteID; member enrichment replaces sectName with orgName, adds bot/app-derived name and isOwner, keeps engName/chineseName/memberCount as enrich-only.
  • Configuration

    • SITE_URL is required and validated for URL rewriting.
  • Documentation

    • Updated client API reference, design and implementation plan.
  • Tests

    • Expanded unit and integration tests for models, subjects, handlers, store queries, and response-size handling.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds two read-only room-service RPCs (GetRoomAppTabs, GetRoomAppCommandMenu), updates member enrichment fields (sectName→orgName, bot name), introduces models and Mongo read/index methods, tightens subject formats with siteID, implements URL rewrite and bounded JSON replies, updates NewHandler signature, and adds comprehensive tests and docs.

Changes

Room Service App Tabs and Command Menu RPCs

Layer / File(s) Summary
Client API & design docs
docs/client-api.md, docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md, docs/superpowers/plans/2026-05-26-room-service-app-tabs-and-cmd-menu.md
Updates member.enrich contract (replace sectNameorgName, add bot name, isOwner enrich-only), makes OrgMembers subject site-aware, and documents Get Room App Tabs / Get Room App Command Menu wire formats and behaviors.
Data models & model tests
pkg/model/user.go, pkg/model/app.go, pkg/model/botcmdmenu.go, pkg/model/member.go, pkg/model/subscription.go, pkg/model/model_test.go
Adds User.Roles + PlatformRoleAdmin + IsPlatformAdmin, App.AvatarURL + ChannelTab, BotCmdMenu/CmdBlock/CmdModal types, RoomMemberEntry Name/OrgName changes, IsRoomMember helper, and extensive serialization/depth tests.
Subject builders & subject tests
pkg/subject/subject.go, pkg/subject/subject_test.go
Tightens ParseUserRoomSubject validation; OrgMembers builders now include siteID; adds RoomAppTabs/RoomAppCmdMenu builders and tests (including negative parse cases).
Store interface & Mongo wiring
room-service/store.go, room-service/store_mongo.go, room-service/mock_store_test.go
Adds RoomBotAppEntry and RoomStore methods: ListDefaultChannelTabApps, ListRoomBotApps, ListActiveCmdMenus; MongoStore wires bot_cmd_menu collection, implements reads, and creates supporting compound indexes.
Handler helpers & authorization
room-service/helper.go, room-service/helper_test.go
Adds sentinel errors, Handler.marshalBounded / replyBoundedJSON with maxResponseBytes enforcement, isURLSafeIDToken, and sanitizeError passthroughs; tests for bounded replies and token validation.
RPC handlers, URL rewrite & wiring
room-service/handler.go, room-service/handler_test.go
Handler gains siteURL and maxResponseBytes; NewHandler signature updated. Implements authorizeRoomAppRead (member or local admin), buildTabURL (template substitution + safe join + query/fragment preservation), handleGetRoomAppTabs, handleGetRoomAppCommandMenu, NATS subscribers, and exhaustive unit tests; updates constructor call sites.
Integration tests & index verification
room-service/integration_test.go
Updates org-display assertions to OrgName; adds bot-enrichment integration test and MongoStore integration tests for the new read methods and index verification.
Startup config & docker
room-service/main.go, room-service/deploy/docker-compose.yml
Adds required SITE_URL config with validation at startup and passes parsed URL and NATS max payload into NewHandler; docker-compose adds SITE_URL for local dev.
Mocks
room-service/mock_store_test.go
Updates MockRoomStore with ListActiveCmdMenus, ListDefaultChannelTabApps, and ListRoomBotApps.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • mliu33

🐰 In the burrow code they scurried fast,

Tabs and menus stitched to SITE_URL at last.
Replies kept tiny, URLs neat and trim,
Bots wear names while humans keep their vim.
Hooray — the rabbit shipped the feature with a grin!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.91% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(room-service): add app.tabs and app.cmd-menu RPCs' is specific, concise, and accurately describes the primary change—adding two new NATS RPCs to room-service.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/determined-fermi-A07HN

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md`:
- Around line 388-404: Add a language tag to the fenced code block that contains
the Mongo aggregation pipeline (the block beginning with the array of stages
like {"$match": {"roomId": roomID, "u.isBot": true}} and the subsequent
{"$lookup": ...} pipeline) by changing the opening triple backticks to include
"json" (i.e., ```json) so markdownlint MD040 is satisfied and the JSON-like
aggregation pipeline renders correctly.

In `@pkg/subject/subject.go`:
- Around line 387-401: RoomAppTabs and RoomAppCmdMenu accept an account token
but do not use the existing account-token guard, enabling
wildcard/special-character leakage; update both functions to call the shared
validator isValidAccountToken(account) at the start and bail out when validation
fails (e.g., return an empty string or otherwise follow the same error/return
pattern used by other account-based builders) so all account-accepting subject
builders consistently enforce token validation.

In `@room-service/handler.go`:
- Around line 1589-1591: The slog.Warn call is logging the raw channel tab URL
template (app.ChannelTab.URL.Default) which may contain sensitive data; change
the log to avoid the full template by removing app.ChannelTab.URL.Default and
instead log only stable identifiers like app.ID and roomID plus a non-sensitive
indicator (e.g., a boolean hasTemplate flag or a one-way hash/fingerprint of
app.ChannelTab.URL.Default) so that slog.Warn("skipping app with empty or
unparseable channelTab url", "appId", app.ID, "roomId", roomID, ...) no longer
emits the raw URL template.

In `@room-service/store_mongo.go`:
- Line 36: Change the singular collection name used when constructing the
botCmdMenus collection to a lowercase plural form: replace the
db.Collection("bot_cmd_menu") call that initializes botCmdMenus with
db.Collection("bot_cmd_menus"), and update any other references (indexes, tests,
docs, and any code that assumes "bot_cmd_menu") to the new "bot_cmd_menus" name
to keep naming consistent with the repository convention.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 49d2bf3d-608c-4f5d-8a17-f6a4dd78804d

📥 Commits

Reviewing files that changed from the base of the PR and between ca6fe82 and d8d1442.

📒 Files selected for processing (20)
  • docs/client-api.md
  • docs/superpowers/plans/2026-05-26-room-service-app-tabs-and-cmd-menu.md
  • docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md
  • pkg/model/app.go
  • pkg/model/botcmdmenu.go
  • pkg/model/model_test.go
  • pkg/model/subscription.go
  • pkg/model/user.go
  • pkg/subject/subject.go
  • pkg/subject/subject_test.go
  • room-service/deploy/docker-compose.yml
  • room-service/handler.go
  • room-service/handler_test.go
  • room-service/helper.go
  • room-service/helper_test.go
  • room-service/integration_test.go
  • room-service/main.go
  • room-service/mock_store_test.go
  • room-service/store.go
  • room-service/store_mongo.go

Comment thread docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md Outdated
Comment thread pkg/subject/subject.go
Comment thread room-service/handler.go
Comment thread room-service/store_mongo.go
@vjauhari-work vjauhari-work force-pushed the claude/determined-fermi-A07HN branch from 7d01d55 to 2aa0ddf Compare May 28, 2026 07:28
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/client-api.md`:
- Around line 867-868: Update the docs for the org-members endpoint to remove
the misleading "room's origin `siteID`" phrasing and explicitly state that
`{siteID}` selects which site's user directory to query for the organization
(i.e., the site whose view of org membership is being returned), matching the
same `member.list` per-site semantics; replace the sentence that mentions
"room's origin site" with a clear one-line explanation that the endpoint is
org-scoped and `{siteID}` denotes the site whose `users` collection should be
used, and add a short example or note clarifying routing/ownership expectations
for clients.

In `@pkg/subject/subject.go`:
- Around line 224-247: OrgMembers and ParseOrgMembersSubject currently allow
wildcard or special characters in tokens (e.g. account/orgId) which reintroduces
wildcard leaks; add a single helper like validateSubjectToken(token string) bool
that rejects tokens containing NATS special characters (at minimum '*' and '>'
and the separator '.') and use it in OrgMembers (validate the account before
building the subject) and in ParseOrgMembersSubject (ensure parts[2], parts[5],
and parts[6] are valid) so malformed subjects like
"chat.user.*.request.orgs.*.site-a.members" cause ParseOrgMembersSubject to
return ok=false and OrgMembers cannot produce subjects from invalid accounts.

In `@room-service/store_mongo.go`:
- Around line 649-702: The bot name enrichment implemented in
attachUserDisplayNames is only used by getRoomSubscriptions, so ListRoomMembers
via getRoomMembers never populates bot Member.Name; update the getRoomMembers
path to invoke attachUserDisplayNames (or inline equivalent logic) on the
members slice before returning so bot accounts get looked up via
findAppsForDisplay and Member.Name is copied onto bot members; specifically
modify getRoomMembers (the function used by ListRoomMembers) to call
s.attachUserDisplayNames(ctx, roomID, members) and handle/propagate errors
similarly to how getRoomSubscriptions does.
- Around line 1110-1118: The projection in ListDefaultChannelTabApps (in
function ListDefaultChannelTabApps) omits the app label so returned model.App
entries have Name == ""; update the projection passed to
options.Find().SetProjection (the bson.M map) to include the "name" field (e.g.,
add "name": 1) so GetRoomAppTabs and any consumers receive the app label
populated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 429c4055-5068-40df-8340-d52d8609d33d

📥 Commits

Reviewing files that changed from the base of the PR and between d8d1442 and 2aa0ddf.

📒 Files selected for processing (21)
  • docs/client-api.md
  • docs/superpowers/plans/2026-05-26-room-service-app-tabs-and-cmd-menu.md
  • docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md
  • pkg/model/app.go
  • pkg/model/botcmdmenu.go
  • pkg/model/member.go
  • pkg/model/model_test.go
  • pkg/model/subscription.go
  • pkg/model/user.go
  • pkg/subject/subject.go
  • pkg/subject/subject_test.go
  • room-service/deploy/docker-compose.yml
  • room-service/handler.go
  • room-service/handler_test.go
  • room-service/helper.go
  • room-service/helper_test.go
  • room-service/integration_test.go
  • room-service/main.go
  • room-service/mock_store_test.go
  • room-service/store.go
  • room-service/store_mongo.go
✅ Files skipped from review due to trivial changes (4)
  • room-service/deploy/docker-compose.yml
  • docs/superpowers/plans/2026-05-26-room-service-app-tabs-and-cmd-menu.md
  • room-service/mock_store_test.go
  • docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md
🚧 Files skipped from review as they are similar to previous changes (10)
  • pkg/model/subscription.go
  • room-service/store.go
  • room-service/helper_test.go
  • pkg/model/app.go
  • room-service/helper.go
  • pkg/model/user.go
  • pkg/model/botcmdmenu.go
  • room-service/main.go
  • room-service/handler.go
  • room-service/handler_test.go

Comment thread docs/client-api.md Outdated
Comment thread pkg/subject/subject.go
Comment thread room-service/store_mongo.go
Comment thread room-service/store_mongo.go
@vjauhari-work vjauhari-work force-pushed the claude/determined-fermi-A07HN branch from ca4ce3f to 5c6d14c Compare June 1, 2026 08:50
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
room-service/handler.go (1)

1583-1590: ⚡ Quick win

Add the request ID to these warning logs.

These are request-scoped warnings, so leaving out the correlation ID makes bad templates much harder to trace back to the triggering RPC. As per coding guidelines: "Generate or extract a unique request/correlation ID at the entry point (HTTP middleware or NATS message handler), propagate via context.Context, include in all log lines."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@room-service/handler.go` around lines 1583 - 1590, The warning logs in the
ChannelTab checks omit the request/correlation ID; update the two slog.Warn
calls inside the loop handling app.ChannelTab (the block referencing
app.ChannelTab, roomID, app.ID and h.buildTabURL) to include the request ID
retrieved from the request context (propagated into this handler) — e.g.,
extract the request ID from ctx (or the contextual logger) and add it as an
extra key/value like "requestId" to both warning logs so every warning includes
the correlation ID for tracing.
room-service/store_mongo.go (1)

141-145: ⚡ Quick win

Drop the second (roomId, u.isBot) index creation.

This block repeats the same CreateOne already executed at Lines 108-112. Keeping both adds an unnecessary startup round-trip and makes future index changes easy to update in only one place.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@room-service/store_mongo.go` around lines 141 - 145, Remove the duplicate
index creation call that attempts to create an index on {"roomId", "u.isBot"}
via s.subscriptions.Indexes().CreateOne; this block is redundant with the
earlier CreateOne call that already creates the same bson.D{{"roomId", 1},
{"u.isBot", 1}} index, so delete this second CreateOne + error-check block and
rely on the original index creation to avoid an extra startup round-trip and
duplicate maintenance points.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@room-service/handler.go`:
- Around line 1419-1435: The authorizeRoomAppRead function currently grants
admin bypass when GetSubscription misses; change it to verify the room exists
first by calling h.store.GetRoom(ctx, roomID) when GetSubscription returns
model.ErrSubscriptionNotFound. If GetRoom returns a not-found error, return
errAppAccessDenied; if GetRoom returns any other error, return fmt.Errorf("check
room existence: %w", err). Only after confirming the room exists should you call
h.store.GetUser and allow model.IsPlatformAdmin to bypass. Keep existing checks
using model.IsRoomMember, model.IsPlatformAdmin, and preserve existing error
wrapping for other error cases.

---

Nitpick comments:
In `@room-service/handler.go`:
- Around line 1583-1590: The warning logs in the ChannelTab checks omit the
request/correlation ID; update the two slog.Warn calls inside the loop handling
app.ChannelTab (the block referencing app.ChannelTab, roomID, app.ID and
h.buildTabURL) to include the request ID retrieved from the request context
(propagated into this handler) — e.g., extract the request ID from ctx (or the
contextual logger) and add it as an extra key/value like "requestId" to both
warning logs so every warning includes the correlation ID for tracing.

In `@room-service/store_mongo.go`:
- Around line 141-145: Remove the duplicate index creation call that attempts to
create an index on {"roomId", "u.isBot"} via
s.subscriptions.Indexes().CreateOne; this block is redundant with the earlier
CreateOne call that already creates the same bson.D{{"roomId", 1}, {"u.isBot",
1}} index, so delete this second CreateOne + error-check block and rely on the
original index creation to avoid an extra startup round-trip and duplicate
maintenance points.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4fb260cf-bfc6-4dfa-aee7-4383680f2bbf

📥 Commits

Reviewing files that changed from the base of the PR and between 2aa0ddf and 5c6d14c.

📒 Files selected for processing (21)
  • docs/client-api.md
  • docs/superpowers/plans/2026-05-26-room-service-app-tabs-and-cmd-menu.md
  • docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md
  • pkg/model/app.go
  • pkg/model/botcmdmenu.go
  • pkg/model/member.go
  • pkg/model/model_test.go
  • pkg/model/subscription.go
  • pkg/model/user.go
  • pkg/subject/subject.go
  • pkg/subject/subject_test.go
  • room-service/deploy/docker-compose.yml
  • room-service/handler.go
  • room-service/handler_test.go
  • room-service/helper.go
  • room-service/helper_test.go
  • room-service/integration_test.go
  • room-service/main.go
  • room-service/mock_store_test.go
  • room-service/store.go
  • room-service/store_mongo.go
✅ Files skipped from review due to trivial changes (2)
  • room-service/mock_store_test.go
  • docs/superpowers/specs/2026-05-26-room-service-app-tabs-and-cmd-menu-design.md
🚧 Files skipped from review as they are similar to previous changes (13)
  • pkg/subject/subject_test.go
  • pkg/model/app.go
  • pkg/model/subscription.go
  • room-service/helper_test.go
  • room-service/main.go
  • room-service/deploy/docker-compose.yml
  • pkg/model/user.go
  • room-service/store.go
  • docs/client-api.md
  • room-service/helper.go
  • pkg/subject/subject.go
  • room-service/handler_test.go
  • room-service/integration_test.go

Comment thread room-service/handler.go Outdated
@mliu33 mliu33 requested a review from yenta June 2, 2026 00:02
@vjauhari-work vjauhari-work force-pushed the claude/determined-fermi-A07HN branch 4 times, most recently from 1cc01b6 to dbc1ee9 Compare June 3, 2026 10:27
Copy link
Copy Markdown
Collaborator

@mliu33 mliu33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks!

Comment thread room-service/handler.go
return model.GetRoomAppTabsResponse{Apps: out}, nil
}

func (h *Handler) handleGetRoomAppCommandMenu(ctx context.Context, subj string, _ []byte) (model.GetRoomAppCommandMenuResponse, error) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Third argument is redundant

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — these are no-body RPCs, so the []byte body param was dead. Dropped it from both handleGetRoomAppTabs and handleGetRoomAppCommandMenu (plus the two NATS wrappers and the test call sites); the signatures now match handleListOrgMembers(ctx, subj). Done in ff87d47.


Generated by Claude Code

…errcode)

Two read-only NATS request/reply RPCs gated by room-membership OR
platform-admin: GetRoomAppTabs and GetRoomAppCommandMenu.

Squash-rebased onto latest main and migrated to the centralized error
handling introduced by #250: sentinels are now *errcode.Error
(errAppAccessDenied -> Forbidden+RoomNotMember, errResponseTooLarge ->
Internal); the NATS wrappers use wrappedCtx's (ctx, err) form + errnats.Reply;
marshalBounded returns ([]byte, error); sanitizeError removed. Invalid-subject
parse failures return errcode.BadRequest.

Includes pkg/model types, pkg/subject builders, three RoomStore methods +
compound indexes, SITE_URL config, and client-api docs. The 38 prior PR
commits are collapsed here because the cross-cutting errcode migration made a
per-commit replay impractical.

https://claude.ai/code/session_016e4UVPcE4kQQoHrYa2H2yB
@vjauhari-work vjauhari-work force-pushed the claude/determined-fermi-A07HN branch from dbc1ee9 to 4b1cd7f Compare June 3, 2026 15:00
@mliu33 mliu33 merged commit 6b73237 into main Jun 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants