fix: use after() instead of fire-and-forget in video webhook#594
Closed
codercatdev wants to merge 1 commit intodevfrom
Closed
fix: use after() instead of fire-and-forget in video webhook#594codercatdev wants to merge 1 commit intodevfrom
codercatdev wants to merge 1 commit intodevfrom
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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