Skip to content
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

FetchObserver (for a single fetch) #607

Open
annevk opened this Issue Sep 22, 2017 · 15 comments

Comments

9 participants
@annevk
Copy link
Member

annevk commented Sep 22, 2017

In #447 (comment) @jakearchibald sketched some APIs based on @stuartpb's work which @bakulf then implemented:

That issue got closed after we landed a subset of that API in Fetch (you can finally abort a fetch). Let's discuss the remainder here (though not priorities, that's #436).

cc @wanderview

@glococo

This comment has been minimized.

Copy link

glococo commented Sep 28, 2017

Hi,
I found no way of observing the progress on Upload fetch()

var garbage = new Float64Array(new ArrayBuffer(104856))
for (let i=0; i<garbage.length; i++) garbage[i] = Math.random()
var gArray = []
for (let i=0; i<100; i++) gArray.push(garbage);
var gBlob = new Blob(gArray) //10MB

var controller = new FetchController(); // FF55 or AbortController() in Firefox58
var signal = controller.signal;
fetch( "/?action=upload",{ signal, observe(observer) { observer.onresponseprogress=e=>console.log(e);observer.onrequestprogress=e=>console.log(e);observer.onstatechange=n=>console.log(observer.state) }, method:"POST", body:gBlob } )

The only working observer is "state" ( Firefox 55/58 Ubuntu)

@rolivo

This comment has been minimized.

Copy link

rolivo commented Oct 10, 2017

What's the status of this?

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Oct 11, 2017

The OP reflects the current status. My priorities right now are fetch abort + service worker & background fetch.

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Oct 12, 2017

@Cap32

This comment has been minimized.

Copy link

Cap32 commented Dec 4, 2017

@wanderview

This comment has been minimized.

Copy link
Member

wanderview commented Dec 4, 2017

Yeah, I think we removed it from MDN when it became apparent the spec was not immediately moving forward.

@rektide

This comment has been minimized.

Copy link

rektide commented Mar 23, 2018

Both #51 and #65 are related.

I would love to see this feature added. It would enable some very interesting new reactive models that mesh well with existing HTTP-centric web-systems. Using websocket & SSE is un-ideal in that messaging done there isn't inherently resource-oriented, unlike Push support.

@RikkiGibson

This comment has been minimized.

Copy link

RikkiGibson commented Apr 18, 2018

FetchObserver would enable us to give users a good experience with file uploads without falling back to XMLHttpRequest. Would really like to see it happen.

@annevk

This comment has been minimized.

Copy link
Member Author

annevk commented Apr 19, 2018

@RikkiGibson I noticed you're working for Microsoft (not that this is a requirement by all means, but having an employer that supports standards development definitely helps). I don't know how much you're into standards and work with the Edge team, but if you have some time you could help make this happen. We basically need to formalize the proposal and work on tests. There's ample implementer interest already.

@oliverjanik

This comment has been minimized.

Copy link

oliverjanik commented Jun 8, 2018

Any update on this? Why is such a basic requirement such as upload progress such problem? Why does it take years of debate?

Give me a callback function if you have to. I'll wrap it in RXJS observable myself.

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Jun 8, 2018

@oliverjanik I think the comment before your's sums up the current situation. If you have time to formalise the proposal and write tests, great!

@rolivo

This comment has been minimized.

Copy link

rolivo commented Jun 8, 2018

@jakearchibald I am a c / c ++ programmer, I could help you write the tests if you tell me how to do it.

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Jun 14, 2018

@rolivo The proposal should probably be formalised first, but if you're interested in contributing tests, https://github.com/web-platform-tests/wpt has the info. https://github.com/web-platform-tests/wpt/tree/master/fetch/api/abort - these are the tests for aborting fetch, in case they're a useful reference.

@oliverjanik

This comment has been minimized.

Copy link

oliverjanik commented Jun 14, 2018

@jakearchibald Who's working on formalising the proposal and how is the work conducted?

Can I lend a hand?

@jakearchibald

This comment has been minimized.

Copy link
Collaborator

jakearchibald commented Jun 14, 2018

@oliverjanik the work is conducted right here. No one's working on it right now. It's something I'll get to eventually unless someone (you?) picks it up before me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.