-
Notifications
You must be signed in to change notification settings - Fork 341
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
fix(http): Fixes Stream Bug #2522
base: v2
Are you sure you want to change the base?
Conversation
This reverts commit 5edea81.
Can you please fix the conflicts? And for future PRs, it is recommended not make PRs from the default branch as it most certainly will cause conflicts. You should always make a new branch for each PR. |
Whoops |
Package Changes Through ea012c1There are 2 changes which include http with minor, http-js with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
#[command] | ||
pub async fn fetch_read_body<R: Runtime>( | ||
webview: Webview<R>, | ||
rid: ResourceId, | ||
stream_channel: Channel<tauri::ipc::InvokeResponseBody>, | ||
) -> crate::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this command below fetch_send so it matches the order they are called on the JS side
@@ -370,7 +359,31 @@ pub fn fetch_cancel<R: Runtime>(webview: Webview<R>, rid: ResourceId) -> crate:: | |||
Ok(()) | |||
} | |||
|
|||
#[tauri::command] | |||
#[command] | |||
pub async fn fetch_read_body<R: Runtime>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to be add in lib.rs
Also you need to run pnpm build |
The problem was that the stream while sending was blocking the await function, not returning
ReadableStream
and the headers after sending.This was fixed by (kind of) bringing back the
fetch_read_body
, I actually wanted to name itfetch_stream_body
, but I don't know how to set up the permissions.On ReadableStream start, it will call a different function (
fetch_read_body
) as to not block the return of the headers onfetch_send
.Fixes #2479 (comment)
@amrbashir