File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,9 +132,15 @@ const ChatOverlay = ({ onClose }) => {
132132 while ( ( newlineIndex = buffer . indexOf ( "\n" ) ) !== - 1 ) {
133133 const line = buffer . slice ( 0 , newlineIndex )
134134 buffer = buffer . slice ( newlineIndex + 1 )
135- if ( line . trim ( ) === "" ) continue
135+ if ( line . trim ( ) === "" ) continue // Skip empty lines
136+
137+ // Log the raw line received from the stream
138+ console . log ( "[ChatStream] Received raw line:" , line )
139+
136140 try {
137141 const parsed = JSON . parse ( line )
142+ // Log the parsed JavaScript object
143+ console . log ( "[ChatStream] Parsed data:" , parsed )
138144 if ( parsed . type === "error" ) {
139145 toast . error ( `An error occurred: ${ parsed . message } ` )
140146 continue
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ async def event_stream_generator():
5454 ):
5555 if not event :
5656 continue
57+ logger .info (f"Streaming event to user { user_id } : { json .dumps (event )} " )
5758 # yield as bytes and flush
5859 yield json .dumps (event ) + "\n "
5960 except asyncio .CancelledError :
You can’t perform that action at this time.
0 commit comments