Skip to content

[cuebot] Complete the gRPC response in ShowInterface.SetCommentEmail#2409

Open
ramonfigueiredo wants to merge 6 commits into
AcademySoftwareFoundation:masterfrom
ramonfigueiredo:cuebot-fix-setcommentemail-hang
Open

[cuebot] Complete the gRPC response in ShowInterface.SetCommentEmail#2409
ramonfigueiredo wants to merge 6 commits into
AcademySoftwareFoundation:masterfrom
ramonfigueiredo:cuebot-fix-setcommentemail-hang

Conversation

@ramonfigueiredo

@ramonfigueiredo ramonfigueiredo commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Related Issues

Summarize your change.

ManageShow.setCommentEmail called responseObserver.onNext(...) but never responseObserver.onCompleted(), so the gRPC stream was never closed and callers hung until they timed out (the email was still written to the database). Every other setter in this servant closes the stream.

Add the missing onCompleted() so the RPC returns promptly, and add a ManageShowTests.testSetCommentEmail regression test - using a recording StreamObserver that asserts onCompleted() was called (the existing FakeStreamObserver has empty methods and wouldn't catch this) and that the comment email is persisted.

Fixes the hang in CueGUI's and CueWeb's Show Properties "Comment Notification Email" field.

Replicates the CueGUI CueCommander Shows window in CueWeb, on top of the existing Create Show modal.

- Stats table: the /shows page now uses the shared SimpleDataTable with a new isShowsTable variant and CueGUI's columns - Show Name, Cores Run (reserved_cores), Frames Run (running_frames), Frames Pending (pending_frames), Jobs (pending_jobs) - loaded from GetActiveShows and auto-refreshing every 30s. Numeric columns sort by their underlying value.
- Row context menu (ShowContextMenu): Show Properties and Create Subscription.
- Show Properties dialog (ShowDialog parity), four tabs: Settings (default max/min cores, comment notification email), Booking (enable booking / enable dispatch), Statistics (read-only show_stats), Raw Show Data. Save calls only the setters whose value changed, then refreshes the table.
- Create Subscription dialog (SubscriptionCreator parity): Show + Alloc dropdowns, Size (100), Burst (110).
- Create Show dialog gains the per-allocation Subscriptions section (checkbox + Size + Burst per allocation), creating the show then a subscription on each checked allocation.
- New proxy routes: show/getactiveshows, allocation/getall, and show/action/ {enablebooking,enabledispatching,setdefaultmaxcores,setdefaultmincores, setcommentemail,createsubscription}. All validate the body (400 on malformed JSON / missing fields) and propagate the gateway's real HTTP status. createsubscription maps Cuebot's duplicate-key error to a short, user-facing "show already has a subscription on that allocation" message.
- get_utils: widen the shared Show type (default cores, comment email, extended show_stats) and add an Allocation type plus getActiveShows / getAllocations; action_utils: enableShowBooking/Dispatching, setShowDefaultMax/MinCores, setShowCommentEmail, createShowSubscription, and the row dispatchers; show-action-events.ts holds the shared dialog event contract.
- Tests: Jest coverage for the show action helpers and the show/allocation get_utils helpers.
Replicates the CueGUI CueCommander Shows window in CueWeb, on top of the existing Create Show modal.

- Stats table: the /shows page now uses the shared SimpleDataTable with a new isShowsTable variant and CueGUI's columns - Show Name, Cores Run (reserved_cores), Frames Run (running_frames), Frames Pending (pending_frames), Jobs (pending_jobs) - loaded from GetActiveShows and auto-refreshing every 30s. Numeric columns sort by their underlying value.
- Row context menu (ShowContextMenu): Show Properties and Create Subscription.
- Show Properties dialog (ShowDialog parity), four tabs: Settings (default max/min cores, comment notification email), Booking (enable booking / enable dispatch), Statistics (read-only show_stats), Raw Show Data. Save calls only the setters whose value changed, then refreshes the table.
- Create Subscription dialog (SubscriptionCreator parity): Show + Alloc dropdowns, Size (100), Burst (110).
- Create Show dialog gains the per-allocation Subscriptions section (checkbox + Size + Burst per allocation), creating the show then a subscription on each checked allocation.
- New proxy routes: show/getactiveshows, allocation/getall, and show/action/ {enablebooking,enabledispatching,setdefaultmaxcores,setdefaultmincores, setcommentemail,createsubscription}. All validate the body (400 on malformed JSON / missing fields) and propagate the gateway's real HTTP status. createsubscription maps Cuebot's duplicate-key error to a short, user-facing "show already has a subscription on that allocation" message.
- get_utils: widen the shared Show type (default cores, comment email, extended show_stats) and add an Allocation type plus getActiveShows / getAllocations; action_utils: enableShowBooking/Dispatching, setShowDefaultMax/MinCores, setShowCommentEmail, createShowSubscription, and the row dispatchers; show-action-events.ts holds the shared dialog event contract.
- Tests: Jest coverage for the show action helpers and the show/allocation get_utils helpers.
Documents CueWeb's CueCommander Shows window (stats table, Create Show, Show Properties, Create Subscription) across the CueWeb docs.

- User guide (cueweb-user-guide.md): new Shows section with the stats table, a Show columns table, Create Show (with subscriptions), the row actions menu, the four Show Properties tabs (Settings / Booking / Statistics / Raw Show Data), and Create Subscription - each with a light screenshot.
- Overview (other-guides/cueweb.md): add a Shows feature entry (stats table, Create Show with per-allocation subscriptions, Show Properties and Create Subscription row actions).
- Reference (reference/cueweb.md): add a Shows behavior section plus Show Properties / Create Subscription subsections, list the new show RPCs and /api/show/... + /api/allocation/getall proxy routes (with body-validation and duplicate-error notes), and mark the Shows route implemented in the roadmap.
- Developer guide (cueweb-development.md): note the SimpleDataTable isShowsTable flag / ShowContextMenu, and add a Shows window section (file layout, stats table, CustomEvent dance, the three dialogs and their validation, action helpers/routes).
- Add Shows screenshots (light + dark) for the page, columns, search, menu, Create Show, Create Subscription, and the four Show Properties tabs.
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 230719d0-2e70-4d05-a9a6-4f491e2d0bd6

📥 Commits

Reviewing files that changed from the base of the PR and between 1a9194b and 6c87b05.

📒 Files selected for processing (3)
  • cueweb/components/ui/create-show-dialog.tsx
  • cueweb/components/ui/create-subscription-dialog.tsx
  • cueweb/components/ui/show-properties-dialog.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • cueweb/components/ui/show-properties-dialog.tsx
  • cueweb/components/ui/create-subscription-dialog.tsx
  • cueweb/components/ui/create-show-dialog.tsx

📝 Walkthrough

Walkthrough

Adds a complete Shows UI to CueWeb (listing, create, properties, subscriptions, table/columns, routes, helpers) and fixes a Cuebot gRPC bug by calling responseObserver.onCompleted() in ManageShow#setCommentEmail; tests and docs included.

Changes

Shows Window (CueCommander Parity)

Layer / File(s) Summary
Backend RPC Completion Fix
cuebot/src/main/java/com/imageworks/spcue/servant/ManageShow.java, cuebot/src/test/java/com/imageworks/spcue/test/servant/ManageShowTests.java
ManageShow#setCommentEmail now calls responseObserver.onCompleted() after emitting the success response. A new testSetCommentEmail verifies onNext/onCompleted are invoked and the comma-separated emails are persisted.
Show Data Model and Utilities
cueweb/app/utils/get_utils.ts, cueweb/components/ui/show-action-events.ts
Show type extended with optional settings/stats fields; getActiveShows() and getAllocations() helpers added; CustomEvent contracts for dialog wiring defined.
API Route Handlers
cueweb/app/api/show/getactiveshows/route.ts, cueweb/app/api/show/action/{enablebooking,enabledispatching,setcommentemail,setdefaultmaxcores,setdefaultmincores,createsubscription}/route.ts, cueweb/app/api/allocation/getall/route.ts
New Next.js proxy routes validate requests, forward to RPC endpoints, map duplicate-key errors to friendly messages, and unwrap nested gateway responses into flat JSON.
Show Action Helpers
cueweb/app/utils/action_utils.ts
Adds show mutation helpers (enableShowBooking, enableShowDispatching, setShowDefaultMaxCores/MinCores, setShowCommentEmail, createShowSubscription) and row-dispatcher functions that emit CustomEvents to open dialogs.
Show Properties Dialog
cueweb/components/ui/show-properties-dialog.tsx
Dialog opens via OPEN_SHOW_PROPERTIES_EVENT, validates inputs, sends only changed updates in parallel, toasts and dispatches SHOWS_CHANGED_EVENT on full success.
Create Subscription Dialog
cueweb/components/ui/create-subscription-dialog.tsx
Mounts once, opens via OPEN_CREATE_SUBSCRIPTION_EVENT, fetches shows/allocations, validates size/burst, calls createShowSubscription, toasts success, and triggers shows refresh.
Create Show Dialog Extended
cueweb/components/ui/create-show-dialog.tsx
Loads allocations, tracks per-allocation subscription rows (enabled/size/burst), validates numeric inputs, creates the show, then creates subscriptions per enabled allocation and reports partial failures.
Shows Table Columns & Page Routing
cueweb/app/shows/show-columns.tsx, cueweb/app/shows/page.tsx, cueweb/app/shows/shows-client.tsx
Adds showColumns for TanStack, simplifies ShowsPage to client wrapper, refactors ShowsClient to fetch/refresh client-side with interval and event-driven updates; renders via SimpleDataTable.
Shows Context Menu & Table Integration
cueweb/components/ui/context_menus/action-context-menu.tsx, cueweb/components/ui/simple-data-table.tsx
Adds ShowContextMenu with "Show Properties" and "Create Subscription..." actions and isShowsTable flag to SimpleDataTable for shows-specific UI (icon, search labels, context menu routing).
Tests
cuebot/src/test/java/com/imageworks/spcue/test/servant/ManageShowTests.java, cueweb/app/__tests__/api/utils/show_action_utils.test.ts, cueweb/app/__tests__/utils/show_get_utils.test.ts
Backend test verifies RPC stream completion and CSV parsing; Jest tests verify show action helpers call correct endpoints/payloads and getActiveShows/getAllocations return arrays or fallback to [].
Documentation
docs/_docs/developer-guide/cueweb-development.md, docs/_docs/reference/cueweb.md, docs/_docs/user-guides/cueweb-user-guide.md, docs/_docs/other-guides/cueweb.md
Developer, reference, and user docs updated to describe the Shows page, dialogs, API routes, validations, and proxy behavior.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

Suggested labels

devdays26

Suggested reviewers

  • lithorus
  • DiegoTavares

Poem

🐰 A rabbit hops in code so bright,

Shows unfurl beneath the UI light,
RPCs close with a tidy cheer,
Dialogs save and subscriptions appear,
Tests nod yes — the logs sleep tight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.86% 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 clearly and concisely describes the main fix: completing the gRPC response in ShowInterface.SetCommentEmail by calling responseObserver.onCompleted().
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

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.

@ramonfigueiredo

Copy link
Copy Markdown
Collaborator Author

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (1)
cueweb/app/api/show/action/setcommentemail/route.ts (1)

40-44: ⚡ Quick win

Shared pattern: eliminate unnecessary JSON parsing and re-wrapping across action routes.

All three action routes (setcommentemail, setdefaultmaxcores, setdefaultmincores) parse handleRoute's NextResponse, extract data, and re-wrap it in an identical structure. Since handleRoute already returns the correctly formatted response ({ data: ... } on success, { error: ... } on failure), these routes can simply return its response directly, removing redundant overhead.

♻️ Apply this refactor to all three routes
  const body = JSON.stringify(jsonBody);
- const response = await handleRoute(method, endpoint, body, true);
- const responseData = await response.json();
-
- if (!response.ok) return NextResponse.json({ error: responseData.error }, { status: response.status });
- return NextResponse.json({ data: responseData.data }, { status: response.status });
+ return await handleRoute(method, endpoint, body, true);
🤖 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 `@cueweb/app/api/show/action/setcommentemail/route.ts` around lines 40 - 44,
The route currently calls handleRoute(method, endpoint, body, true), awaits
response.json(), and re-wraps that payload into a new NextResponse.json;
instead, return the original response directly to avoid redundant parsing and
re-wrapping—replace the block in setcommentemail's route handler that does const
response = await handleRoute(...); const responseData = await response.json();
if (!response.ok) ... return NextResponse.json(...) with a single return of the
awaited response (same change should be applied identically in the
setdefaultmaxcores and setdefaultmincores route handlers) so handleRoute's
existing { data: ... } / { error: ... } response shape is preserved.
🤖 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 `@cueweb/components/ui/show-properties-dialog.tsx`:
- Around line 105-109: Validation currently treats empty strings as zero because
Number("") === 0; before converting maxCores/minCores to numbers (where
nextMax/nextMin are computed) and in the two other validation paths that parse
those inputs, explicitly reject empty values by checking value.trim() === "" and
show the existing toastWarning (or appropriate error) instead of parsing; then
only call Number(...) after the non-empty check and continue the existing
finite/non-negative checks (update places referencing maxCores, minCores,
nextMax, nextMin accordingly).

---

Nitpick comments:
In `@cueweb/app/api/show/action/setcommentemail/route.ts`:
- Around line 40-44: The route currently calls handleRoute(method, endpoint,
body, true), awaits response.json(), and re-wraps that payload into a new
NextResponse.json; instead, return the original response directly to avoid
redundant parsing and re-wrapping—replace the block in setcommentemail's route
handler that does const response = await handleRoute(...); const responseData =
await response.json(); if (!response.ok) ... return NextResponse.json(...) with
a single return of the awaited response (same change should be applied
identically in the setdefaultmaxcores and setdefaultmincores route handlers) so
handleRoute's existing { data: ... } / { error: ... } response shape is
preserved.
🪄 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: 1c140201-7d85-4ea8-8bbd-ce74182a9793

📥 Commits

Reviewing files that changed from the base of the PR and between de826ac and ed142fb.

⛔ Files ignored due to path filters (24)
  • docs/assets/images/cueweb/cueweb_cuecommander_shows.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_columns.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_columns_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_create_new_show.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_create_new_show_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_create_subscription_menu.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_create_subscription_menu_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_create_subscription_window.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_create_subscription_window_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_menu.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_menu_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_booking_tab.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_booking_tab_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_raw_show_data_tab.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_raw_show_data_tab_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_settings_tab.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_settings_tab_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_statistics_tab.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_properties_menu_statistics_tab_dark.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_search.png is excluded by !**/*.png
  • docs/assets/images/cueweb/cueweb_cuecommander_shows_search_dark.png is excluded by !**/*.png
📒 Files selected for processing (27)
  • cuebot/src/main/java/com/imageworks/spcue/servant/ManageShow.java
  • cuebot/src/test/java/com/imageworks/spcue/test/servant/ManageShowTests.java
  • cueweb/app/__tests__/api/utils/show_action_utils.test.ts
  • cueweb/app/__tests__/utils/show_get_utils.test.ts
  • cueweb/app/api/allocation/getall/route.ts
  • cueweb/app/api/show/action/createsubscription/route.ts
  • cueweb/app/api/show/action/enablebooking/route.ts
  • cueweb/app/api/show/action/enabledispatching/route.ts
  • cueweb/app/api/show/action/setcommentemail/route.ts
  • cueweb/app/api/show/action/setdefaultmaxcores/route.ts
  • cueweb/app/api/show/action/setdefaultmincores/route.ts
  • cueweb/app/api/show/getactiveshows/route.ts
  • cueweb/app/shows/page.tsx
  • cueweb/app/shows/show-columns.tsx
  • cueweb/app/shows/shows-client.tsx
  • cueweb/app/utils/action_utils.ts
  • cueweb/app/utils/get_utils.ts
  • cueweb/components/ui/context_menus/action-context-menu.tsx
  • cueweb/components/ui/create-show-dialog.tsx
  • cueweb/components/ui/create-subscription-dialog.tsx
  • cueweb/components/ui/show-action-events.ts
  • cueweb/components/ui/show-properties-dialog.tsx
  • cueweb/components/ui/simple-data-table.tsx
  • docs/_docs/developer-guide/cueweb-development.md
  • docs/_docs/other-guides/cueweb.md
  • docs/_docs/reference/cueweb.md
  • docs/_docs/user-guides/cueweb-user-guide.md

Comment thread cueweb/components/ui/show-properties-dialog.tsx
ManageShow.setCommentEmail called responseObserver.onNext(...) but never responseObserver.onCompleted(), so the gRPC stream was never closed and callers hung until they timed out (the email was still written to the database). Every other setter in this servant closes the stream.

Add the missing onCompleted() so the RPC returns promptly, and add a ManageShowTests.testSetCommentEmail regression test - using a recording StreamObserver that asserts onCompleted() was called (the existing FakeStreamObserver has empty methods and wouldn't catch this) and that the comment email is persisted.

Fixes the hang in CueGUI's and CueWeb's Show Properties "Comment Notification Email" field.
@ramonfigueiredo ramonfigueiredo force-pushed the cuebot-fix-setcommentemail-hang branch from ed142fb to 1a9194b Compare June 11, 2026 03:56
Number("") and Number("  ") return 0, so a blank numeric field passed the finite/non-negative checks as a valid 0 and could silently persist an unintended zero default or subscription value. Reject empty/whitespace input explicitly before parsing in all three paths:

- Show Properties dialog: default max/min cores.
- Create Subscription dialog: Size / Burst.
- Create Show dialog: each checked allocation's Size / Burst.

Each blocks submit with the message it already used (toast or inline error); the existing NaN/negative checks still cover the other invalid cases.
@ramonfigueiredo

ramonfigueiredo commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

@DiegoTavares / @lithorus
Ready for review!

For this PR you only need to review this commit: 1a9194b

The rest is from the PR:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant