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] Allow download retry+throttling in unified code with blazor #88910

Merged
merged 20 commits into from
Jul 20, 2023

Conversation

maraf
Copy link
Member

@maraf maraf commented Jul 14, 2023

  • Allow download retry+throttling in unified code with blazor
  • Fix advanced sample
  • Add WBT checking for download resource counters (onDownloadResourceProgress)
  • Export type DotnetHostBuilder (unrelated, used in blazor)

@maraf maraf added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Jul 14, 2023
@maraf maraf added this to the 8.0.0 milestone Jul 14, 2023
@maraf maraf self-assigned this Jul 14, 2023
@ghost
Copy link

ghost commented Jul 14, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Allow download retry+throttling in unified code with blazor
  • Fix advanced sample
  • Add WBT checking for donwload resource counters (onDownloadResourceProgress)
Author: maraf
Assignees: maraf
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript, os-browser

Milestone: 8.0.0

@maraf maraf marked this pull request as ready for review July 14, 2023 19:56
@radical
Copy link
Member

radical commented Jul 14, 2023

Does this fix the issue seen in #88505 (comment) ?
cc @pavelsavara

@maraf
Copy link
Member Author

maraf commented Jul 14, 2023

Does this fix the issue seen in #88505 (comment) ?

Yes, it does

@radical
Copy link
Member

radical commented Jul 14, 2023

Does this fix the issue seen in #88505 (comment) ?

Yes, it does

Would it be possible to add some test to check that?

@maraf
Copy link
Member Author

maraf commented Jul 14, 2023

Does this fix the issue seen in #88505 (comment) ?

Yes, it does

Would it be possible to add some test to check that?

That is the case with fetchFailure=true, when the custom loader throws error when fetching resource.

@maraf maraf requested a review from radical July 19, 2023 10:10
@maraf
Copy link
Member Author

maraf commented Jul 19, 2023

Failures are unrelated

testOutput("Throw error instead of downloading resource");
const error = new Error("Simulating a failed fetch");
error.silent = true;
throw error;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this get surfaced to the user at all? What behavior does blazor have when we fail to load an assembly at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this PR, the Blazor aborts on first download failure. Their original approach was to let the user override loadBootResource do retries by themself. After discussion with @pavelsavara we agreed that turn-on our built-in retry support.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant, is this surfaced when even a 3rd retry fails?

[Theory]
[InlineData(false)]
[InlineData(true)]
public async Task DownloadProgressFinishes(bool failAssemblyDownload)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to indicate that this is testing retries.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(intended) Retry happens only when failAssemblyDownload=true

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and that's what we are testing here :)

Copy link
Member Author

@maraf maraf Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are testing "download progress" counter, one case is with retry and one is without

@maraf maraf merged commit 1aafc6f into dotnet:main Jul 20, 2023
26 of 29 checks passed
@maraf maraf deleted the WasmDownloadRetryForSdk branch July 20, 2023 12:51
@ghost ghost locked as resolved and limited conversation to collaborators Aug 20, 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.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants