Repository navigation
chore(security): retire CastingWords (same change as products#1923) - #45
Merged
Merged
Conversation
…products#1923) skill-lesson's castingwords.ts and sanity.ts imported each other, the CastingWords webhook is dead on the products sites, and this project serves no public domain. Remove the CastingWords route, modules and env declaration; sanityVideoResourceWebhook only creates and records the Mux asset, and leaves a resource that already has one alone.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…k failures (review)
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same change as skillrecordings/products#1923, for scriptkit. The
scriptkitVercel project serves onlyproducts-scriptkit.vercel.app(scriptkit.com is a separate deployment), so nothing here receives CastingWords or Sanity video webhooks today.Why
/api/webhooks/castingwordshas crashed on module load (ReferenceError: Cannot access 'k' before initialization) on every production build Vercel still keeps: epic-web back to 2026-03, total-typescript back to 2026-02. The cause is that skill-lesson'scastingwords.tsandsanity.tsimported each other. The cycle has been in the source since June 2023./api/webhooks/sanity/videoResource/created, which is where the CastingWords orders were placed, so nothing has ordered a transcript in that time. epic-web orders Deepgram, and epic-react isn't live.What changes
/api/webhooks/castingwordsin epic-web, total-typescript, epic-react and the create-skill-app template. In skill-lesson:castingwords.ts, the unused duplicatecasting-words.ts(unpatched keyed URLs, no importers),storeCaptionForMux,CASTINGWORDS_GET_TTL_SECONDS, and the sec-167 webhook tests that only covered the removed code.sanityVideoResourceWebhook: now only creates the Mux asset (presigned GET, sec-165) and records{duration, muxAsset}. No transcript order, and nocastingwordsfield is written.muxAsset.muxAssetIdanswers 200 and does nothing. No Mux call, no Sanity patch.CASTINGWORDS_API_TOKENtype declarations, total-typescript's.env.testvalue, and the CastingWords msw mocks are gone.castingwordstranscript and SRT fields in Sanity stay readable. The schemas, the lesson queries and epic-web's/api/videoResource/[id]/srtare untouched.Review focus: total-typescript's video-created webhook starts working again
Breaking the import cycle revives
/api/webhooks/sanity/videoResource/createdon total-typescript, which has returned 500 for at least nine months. Once it works, a new video resource gets a Mux asset again, which is what the route is for.Tests
lib/upload-presigned-callers.test.ts:{duration, muxAsset}, and nofetchto any transcription service;Both fail on
main: main orders CastingWords and patches. skill-lessonlib/is 24/24. tsc is clean on the changed files, and prettier is clean.After merge
CASTINGWORDS_API_TOKENfrom the epic-web, total-typescript-turbo and scriptkit Vercel projects.Rollback
Revert this PR. It only removes code that has been crashing; the replay guard is the one behavior change on a live route.