This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24023 - [Streams API] Returned promise of write() should be fulfilled with current available space size rather than how many bytes were written
Summary: [Streams API] Returned promise of write() should be fulfilled with current av...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Streams API (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Takeshi Yoshino
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-06 18:12 UTC by Takeshi Yoshino
Modified: 2014-01-30 05:12 UTC (History)
3 users (show)

See Also:


Attachments

Description Takeshi Yoshino 2013-12-06 18:12:43 UTC
The returned value is not useful. I made this return the number of bytes actually written so that the writer can know how many bytes were written, but what the writer is interested in is how many bytes are writable now.
Comment 1 Takeshi Yoshino 2013-12-06 18:31:38 UTC
What we really should do is
- consult dataSink (application specific logic) to determine how large (size, cost) a certain object is.

dataSink (possibly asynchronously) computes the cost of a certain object written to it. pendingWriteQueue is built based on that cost.

Non real application, generic consumer such as ByteStream introduced in the spec doesn't know how to compute cost for given object. So, it needs to be educated via e.g. write()'s second argument as I proposed in https://www.w3.org/Bugs/Public/show_bug.cgi?id=23977 .
Comment 2 Takeshi Yoshino 2014-01-30 04:28:01 UTC
(In reply to Takeshi Yoshino from comment #1)
> What we really should do is
> - consult dataSink (application specific logic) to determine how large
> (size, cost) a certain object is.
> 
> dataSink (possibly asynchronously) computes the cost of a certain object
> written to it. pendingWriteQueue is built based on that cost.
> 
> Non real application, generic consumer such as ByteStream introduced in the
> spec doesn't know how to compute cost for given object. So, it needs to be
> educated via e.g. write()'s second argument as I proposed in
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=23977 .

Pasted wrong bug. This is the right one.
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24445
Comment 3 Takeshi Yoshino 2014-01-30 05:12:43 UTC
(In reply to Takeshi Yoshino from comment #2)
> (In reply to Takeshi Yoshino from comment #1)
> > What we really should do is
> > - consult dataSink (application specific logic) to determine how large
> > (size, cost) a certain object is.
> > 
> > dataSink (possibly asynchronously) computes the cost of a certain object
> > written to it. pendingWriteQueue is built based on that cost.
> > 
> > Non real application, generic consumer such as ByteStream introduced in the
> > spec doesn't know how to compute cost for given object. So, it needs to be
> > educated via e.g. write()'s second argument as I proposed in
> > https://www.w3.org/Bugs/Public/show_bug.cgi?id=23977 .
> 
> Pasted wrong bug. This is the right one.
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=24445

This comment is just a mistake. Please ignore.

Anyway, as https://www.w3.org/Bugs/Public/show_bug.cgi?id=24445 is changing the role of the Promise returned by the write() method, this bug is obsolete.