getsentry / getsentry/sentry-javascript

[Replay] Read response body stream instead of `body.text()`

Đang mở
#9,635 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Browser Improvement Replays
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

Currently, we use `await body.text()` to get the response body of a fetch request for replay, both to get the body content as well as to calculate the length of the body.

This has the problem that if the body is a continuous stream, this will never (or very late) resolve. We kind-of solved this recently at least insofar as that we abort after 500ms, but since we still called `await body.text()` before we'll continue to read from the stream, even if we are discarding it.

We should look into reading the stream manually instead of using `body.text()`, which would unlock us being able to stop reading it after some time. But this means we need to take care of text conversion in there ourselves.

Related to https://github.com/getsentry/sentry-javascript/issues/9616

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.