Skip to content

[Demo] Fix streamed recipe/chat SSE session handling#2302

Merged
chr-hertel merged 1 commit into
symfony:mainfrom
chr-hertel:fix-demo-sse-streaming
Jul 11, 2026
Merged

[Demo] Fix streamed recipe/chat SSE session handling#2302
chr-hertel merged 1 commit into
symfony:mainfrom
chr-hertel:fix-demo-sse-streaming

Conversation

@chr-hertel

@chr-hertel chr-hertel commented Jul 11, 2026

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #2299
License MIT

The recipe and stream demos use Server-Sent Events, and the SSE endpoints broke after the session-handling change in 3bfb360: the framework saved the real session while the streamed body was already sending output ("Failed to start the session because headers have already been sent").

Restores the session-swap approach (thanks @valtzu) so the framework saves a throwaway session on kernel.response, while the real session is only used inside the streamed callback.

The related empty-message guard (skip the model call on reconnecting/stale SSE connections) is handled separately in #2304, which introduces the MessageBag helper it relies on.

@chr-hertel chr-hertel requested a review from OskarStark as a code owner July 11, 2026 20:10
@carsonbot carsonbot added Bug Something isn't working Demo Issues & PRs about the demo application Status: Needs Review labels Jul 11, 2026
@chr-hertel chr-hertel force-pushed the fix-demo-sse-streaming branch from b54b8d1 to e6d2049 Compare July 11, 2026 20:26
@chr-hertel chr-hertel merged commit 690a7d2 into symfony:main Jul 11, 2026
422 of 423 checks passed
@chr-hertel chr-hertel deleted the fix-demo-sse-streaming branch July 11, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Demo Issues & PRs about the demo application Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Demo] Streamed demos do not work

2 participants