-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sse.ts handles chunks errors #798
Comments
catch里不是处理了么 |
@c121914yu catch仅考虑了排除ping开头的情况。我遇到的情况是chunk不完整的情况下上半部分丢失,导致parse后续所有的chunk被拼接到storeReadData并一直返回空对象,最终结果是界面上仅显示部分内容。 |
对的呀。不是 ping 开头就拼接 |
@c121914yu 我更新了一下问题,麻烦你看一下。 |
@c121914yu I updated the question, please take a look. |
了解了,是指丢包的情况? |
不存在丢包问题,是一个chunk被分成两个部分(任何位置例如从event:ans开始切成两个部分,事件类型被破坏)。 |
There is no packet loss problem. It is a problem caused by a chunk being divided into two parts and the upper part not being placed in storeReadData. |
sse.ts的parseStreamChunk方法未考虑chunk不完整的情况,导致不完整的chunk被丢弃(上半部分)。不完整的chunk(下半部分)会导致后续的chunk无法解析json。最终导致仅显示部分内容。
请考虑使用更加健壮的库处理sse( https://github.com/Azure/fetch-event-source.git )。
The text was updated successfully, but these errors were encountered: