Skip to content

fix: use after() instead of fire-and-forget in video webhook#594

Closed
codercatdev wants to merge 1 commit intodevfrom
fix/webhook-waituntil
Closed

fix: use after() instead of fire-and-forget in video webhook#594
codercatdev wants to merge 1 commit intodevfrom
fix/webhook-waituntil

Conversation

@codercatdev
Copy link
Contributor

Critical Bug Fix — Pipeline silently dying on Vercel

Problem

The video webhook used fire-and-forget to trigger the pipeline and return 200 immediately. On Vercel serverless, functions terminate after the response is sent, so the pipeline silently died after setting audio_gen status.

Fix

Replace fire-and-forget with after() from next/server. This keeps the function alive for background work after the response.

Impact

Unblocks the entire E2E pipeline — without this fix, no video gets past audio_gen on Vercel.

Files changed

  • app/api/webhooks/sanity-content/route.ts (+10 / -4 lines)

On Vercel serverless, functions terminate after the response is sent.
The fire-and-forget pattern (promise.catch() without await) caused the
video pipeline to silently die after setting audio_gen status.

next/server's after() keeps the function alive for background work,
allowing the full pipeline (ElevenLabs TTS → GCS → Remotion → GCS)
to complete after returning 200 to Sanity.
@vercel
Copy link

vercel bot commented Mar 3, 2026

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

Project Deployment Actions Updated (UTC)
codingcat-dev Building Building Preview, Comment Mar 3, 2026 2:33pm

@codercatdev codercatdev closed this Mar 3, 2026
@codercatdev codercatdev deleted the fix/webhook-waituntil branch March 3, 2026 18:02
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.

1 participant