Re: [ServiceWorker] Backpressure on fetch integrated with Streams (#452)

> In terms of an empty body, I think it should be represented as an empty String / ArrayBuffer

Agreed!

> In terms of a fully consumed body, I don't see a strong reason to treat it differently from an empty body.

Well, it kind of indicates that somebody already consumed the body, so I thought it would be good to error in that case.

But I realized that an empty string (with no chunks enqueued) is automatically closed. So there is no way to distinguish between "empty" and "read to the end", except I guess out-of-band information like Content-Length. So I see your point.

> I don't have a specific example, but developers would want to distinguish an empty response from a communication error.

Agreed with this too. Yet again JavaScript's paucity of error types strikes us :(.

---

In combination, I end up agreeing with you. So, @tyoshino's 1 from https://github.com/slightlyoff/ServiceWorker/issues/452#issuecomment-71785894 sounds good to me.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/452#issuecomment-71956679

Received on Thursday, 29 January 2015 02:11:15 UTC