Conversation
|
@davemurphysf The way you changed the regex, it will now only match the prefix "data: " with a space after the colon. When there is no space after the colon, e.g. "data:Hello", it won't parse the message correctly anymore. That is a big problem. I think you want to use this regex: |
|
@davemurphysf Also, beware that line 208 currently removes all trailing whitespace from the line, so if the data is just a space or ends with a space, you would still handle it incorrectly: line = parts[i].trim();For example, consider a token like |
|
I've fixed.please use https://www.npmjs.com/package/react-native-ssec |
|
@litongjava Why create a new package and not make a pull request to this one so existing users can befenit? |
|
because we need to fix it with on line build
…On Tue, Jun 4, 2024 at 2:11 AM Emil Junker ***@***.***> wrote:
@litongjava <https://github.com/litongjava> Why create a new package and
not make a pull request to this one so existing users can befenit?
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHSKMPMN2N4DJ53C274X7ELZFWVGLAVCNFSM6AAAAABE36I4UCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBXGM3TQMRSHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
When processing an event right now, if a SSE event starts with a space or is just made up of space characters, the regex filtering the
data:field will remove all of the spaces before it finds a non-space character.I read the spec and says the space after the colon should be ignored, but all other characters until the newline.
Example streaming response from ChatGPT showing when this is an issue: when asking
What is 10-3, it returns:Which will currently produce: