Skip to content

feat(core): Add shared flushIfServerless function #17177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jul 25, 2025

Follow-up for this PR: #17168

Creating a shared function flushIfServerless as this functionality is used quite often in various SDKs.

@s1gr1d s1gr1d requested review from Lms24 and AbhiPrasad July 25, 2025 13:37
}
})(),
);
await flushIfServerless();
Copy link

Choose a reason for hiding this comment

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

Bug: Blocking Behavior in Non-Vercel Serverless Environments

The change from vercelWaitUntil to await flushIfServerless() introduces blocking behavior in serverless environments other than Vercel or Cloudflare (e.g., AWS Lambda, Google Cloud Functions). While flushIfServerless uses non-blocking approaches for Vercel/Cloudflare, it falls back to a blocking await flush() in other environments, potentially impacting middleware performance and response times.

Locations (1)

Fix in CursorFix in Web

@s1gr1d s1gr1d force-pushed the sig/flushIfServerless-core branch from 6229acd to 4478ec6 Compare July 25, 2025 14:00
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