Unverified Commit 2d0d3365 authored by Joel's avatar Joel Committed by GitHub

fix: buffer not return event show errors (#149)

parent 54a65714
...@@ -78,7 +78,7 @@ const handleStream = (response: any, onData: IOnData, onCompleted?: IOnCompleted ...@@ -78,7 +78,7 @@ const handleStream = (response: any, onData: IOnData, onCompleted?: IOnCompleted
if (message.startsWith('data: ')) { // check if it starts with data: if (message.startsWith('data: ')) { // check if it starts with data:
// console.log(message); // console.log(message);
bufferObj = JSON.parse(message.substring(6)) // remove data: and parse as json bufferObj = JSON.parse(message.substring(6)) // remove data: and parse as json
if (bufferObj.status === 400) { if (bufferObj.status === 400 || !bufferObj.event) {
onData('', false, { onData('', false, {
conversationId: undefined, conversationId: undefined,
messageId: '', messageId: '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment