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

Client issue when targeting blazor wasm #174

Open
ralinator opened this issue Dec 28, 2024 · 0 comments
Open

Client issue when targeting blazor wasm #174

ralinator opened this issue Dec 28, 2024 · 0 comments
Labels
Bug Something isn't working Requires Triage This issue has not been checked by the project team.

Comments

@ralinator
Copy link

Describe the bug

Sorry wasn't sure if this should be a discussion point or an issue as support for blazor wasm isn't included in the supported platforms but I was thinking given that there is a bit of a drive from the MS side with these new templates to have blazor web apps and blazor hybrid apps sharing code etc. that it might be worth considering? Also to note once this one issue was fixed when I was running locally I was able to get the sync fully working with blazor wasm, there weren't any further blockers in order to get the sync or anything else on the client side working as far as I can tell.

The bug itself manifests when you want to pull/push to the server and it throws an error like below.
Image
If my understanding is correct this is where the exception actually gets thrown
https://source.dot.net/#System.Net.Http/System/Net/Http/[HttpClientHandler.cs](https://source.dot.net/#System.Net.Http/System/Net/Http/HttpClientHandler.cs,141),141
Then on the datasync repo it is trying to do this set in here https://github.com/CommunityToolkit/Datasync/blob/main/src/CommunityToolkit.Datasync.Client/Http/HttpClientExtensions.cs#L37

To Reproduce

Steps to reproduce the behavior:

I'm happy to create a minimal repro if required, just wanted to check first if doing the required fix for this project is even desired given it isn't a supported platform

  1. Create a solution using a blazor webassembly project as the client with sqlite set up (something similar to this https://github.com/[DavidH102/DotNet8-Blazor-WebAPP-with-SQLite-WASM](https://github.com/DavidH102/DotNet8-Blazor-WebAPP-with-SQLite-WASM), mine was a little different in a private personal project)
  2. Set up datasync using the standard documentation
  3. Try to pull/push from the server

Expected behavior

For the code that is looking to set automatic decompression to conditionally ignore this part of the code that throws the platformnotsupportedexception based on the platform. A fix that I have tested locally in the HttpClientFactory is the below -
Image

What platforms?

Note: Any bug or feature request that is opened for an unsupported environment will be automatically closed.

  • Server:

    • Version of dotnet being used to compile? dotnet 8
    • Library versions? 8.0.4
    • What database are you using? Cosmos DB
    • Where are you running the server? Locally in kestrel
    • GitHub repository containing the code (optional, but helps!) Is in a private repo but happy to create minimal repro
  • Client:

    • What platform (Android, iOS, Windows, etc.) versions are you running on? MS Edge on windows
    • Does it happen in an emulator / simulator, or only on a real device? N/A
    • Version of dotnet being used to compile? dotnet 8
    • .NET Runtime Environment (WPF, UWP, WinUI3, MAUI, etc.): Blazor WASM
    • Datsync Toolkit NuGet versions? 8.0.4
    • GitHub repository containing the code (optional, but helps!) Is in a private repo but happy to create minimal repro

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

@ralinator ralinator added Bug Something isn't working Requires Triage This issue has not been checked by the project team. labels Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Requires Triage This issue has not been checked by the project team.
Projects
None yet
Development

No branches or pull requests

1 participant