Skip to content

latest mux typescript sdk#232

Merged
philcluff merged 7 commits into
mainfrom
js/latest-typescript-sdk
Apr 16, 2026
Merged

latest mux typescript sdk#232
philcluff merged 7 commits into
mainfrom
js/latest-typescript-sdk

Conversation

@jsanford8

@jsanford8 jsanford8 commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Note

Medium Risk
Touches production webhook verification/parsing and workflow-resume routing; regressions could cause missed/failed workflow hook resumes despite being mostly an SDK migration.

Overview
Updates the vendored @mux/mux-node dependency to 14.0.0-alpha.4 and migrates Robots-related typings/usages to the new robots-preview surface across the workflow, moderation, and Slack notifier code.

Refactors the Mux webhook handler to use mux.webhooks.unwrap(...) (instead of manual JSON parse + signature verify), introduces explicit terminal Robots event typing, and adds safer dev-mode parsing plus clearer handling for caption track ready/errored events.

Reviewed by Cursor Bugbot for commit 77abe5a. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Apr 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stream-new Ready Ready Preview, Comment Apr 16, 2026 4:20am

Request Review

Comment thread app/api/webhooks/mux/route.ts
Comment thread app/api/webhooks/mux/route.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 77abe5a. Configure here.

const token =
workflow === 'moderate' ? moderationHookToken(assetId)
: workflow === 'summarize' ? summarizeHookToken(assetId)
: askQuestionsHookToken(assetId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Regex match groups unused; SDK data source may diverge

Medium Severity

The regex on line 116 captures workflow and status groups from the event type string, but those captured values are completely discarded. Instead, workflow and status are read from jobData.workflow and jobData.status (SDK typed data). The old code used the regex groups directly, guaranteeing the values matched 'moderate' | 'summarize' | 'ask_questions'. If the SDK's workflow property uses a different format (e.g., different casing or delimiters) than what appears in the event type string, the token selection would silently pick the wrong hook — specifically, any non-matching workflow value falls through to askQuestionsHookToken instead of moderationHookToken or summarizeHookToken. Since this is a pre-release alpha SDK, this coupling is fragile.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 77abe5a. Configure here.

@philcluff philcluff left a comment

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.

Looks great!

@cjpillsbury cjpillsbury 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.

A few areas that could be improved and the robot feedback is reasonable, but nothing that should block merging. 🚢 🇮🇹

@philcluff philcluff merged commit f636425 into main Apr 16, 2026
5 checks passed
@philcluff philcluff deleted the js/latest-typescript-sdk branch April 16, 2026 14:37
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