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

[browser][wasm] Request Streaming upload via http handler #36634

Closed
kjpou1 opened this issue May 18, 2020 · 6 comments · Fixed by #91295
Closed

[browser][wasm] Request Streaming upload via http handler #36634

kjpou1 opened this issue May 18, 2020 · 6 comments · Fixed by #91295
Assignees
Labels
arch-wasm WebAssembly architecture area-System.Net.Http
Milestone

Comments

@kjpou1
Copy link
Contributor

kjpou1 commented May 18, 2020

During the initial review of the browser wasm code integration it was brought to the attention that the request content may not be sufficient in its current state.

There needs to be more investigation into whether there is a way to stream the request content. The issue being that not being able to handle this scenario may result in the buffering of huge amounts of data is some scenarios.

These scenarios need to be identified and solution coded if there is a way to achieve this using the browser API.

Initial investigation leads to some sort of wrapping the javascript Streams API and exposing it in some way via .NET stream.

Model being:

fetch('/', {
  method: 'POST', 
  body: new ReadableStream({
    pull: function(controller) {
      console.log('pull called!');
      controller.enqueue('Some data...');
    }
  })
});

Right now this does not seem to work as per the discussion here: whatwg/fetch#425 (comment)

As well as multiple issues outstanding.

Also to keep in mind the streaming API is still marked experimental in the documentation.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Net.Http untriaged New issue has not been triaged by the area owner labels May 18, 2020
@ghost
Copy link

ghost commented May 18, 2020

Tagging subscribers to this area: @dotnet/ncl
Notify danmosemsft if you want to be subscribed.

@kjpou1 kjpou1 added the arch-wasm WebAssembly architecture label May 18, 2020
@kjpou1 kjpou1 self-assigned this May 18, 2020
@marek-safar marek-safar removed the untriaged New issue has not been triaged by the area owner label Jun 30, 2020
@marek-safar marek-safar added this to the Future milestone Jun 30, 2020
@guardrex
Copy link

guardrex commented Feb 4, 2023

@pavelsavara ... I'm in the process of adding remarks to the Blazor WASM File uploads topic to alert readers to the limitation of the current BrowserHttpHandler implementation for large file uploads.

Pavel, I'll ping you as a reviewer, as I have a question about this issue cross-link in the new text. The PR will be up on Monday, 2/6.

@pavelsavara
Copy link
Member

@guardrex streaming HTTP is still not supported by browsers as far as I could tell.

See https://chromestatus.com/feature/5274139738767360

@campersau
Copy link
Contributor

It is supported by Chrome / Edge (https://developer.chrome.com/articles/fetch-streaming-requests/) but not by Firefox (mozilla/standards-positions#663) or Safari (WebKit/standards-positions#24)

@pavelsavara
Copy link
Member

It is supported by Chrome / Edge (https://developer.chrome.com/articles/fetch-streaming-requests/) but not by Firefox (mozilla/standards-positions#663) or Safari (WebKit/standards-positions#24)

Thanks @campersau!

We could possibly implement it and hide it behind option similar to WebAssemblyEnableStreamingResponse we already have.
@lewing Do you see this is as Net8 priority ?

@lewing lewing modified the milestones: Future, 9.0.0 Jul 11, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 30, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Sep 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Net.Http
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants