Skip to content

Cloudflare Worker are not waiting for streaming events #18360

@JPeer264

Description

@JPeer264

Problem

In getsentry/sentry-mcp#652 we had to manually wait for the flush to ensure that async operations completed before the response was sent.

This was caused by the MCP server streaming data after the actual request has been finished. When using the Cloudflare SDK with MCP servers (or other streaming APIs), spans created during the streaming phase were not being flushed properly because the flush() method would complete before these async spans finished.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions