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

HybridWebView - RawMessageReceived event is not firing in .NET MAUI 9 RC1 #24705

Closed
egvijayanand opened this issue Sep 11, 2024 · 7 comments
Closed
Labels
area-controls-hybridwebview HybridWebView control i/regression This issue described a confirmed regression on a currently supported version platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@egvijayanand
Copy link
Contributor

egvijayanand commented Sep 11, 2024

Description

HybridWebView - RawMessageReceived event is not firing in .NET MAUI 9 RC1.

This worked fine in .NET MAUI 9 Preview 7.

Note: Add the RC1 version in the Version with bug field and Preview 7 version in the Last version that worked well field.

Steps to Reproduce

  1. Clone the solution in the referenced GitHub repo
  2. Build and run the app
  3. Type and send a message from JS to C# from the second text field from the top.
  4. Typically, this message would be received in the code-behind event handler but it's not working

Link to public reproduction project repository

https://github.com/egvijayanand/maui-issue-24705

Version with bug

9.0.0-rc.1.24453.9

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI.

Last version that worked well

9.0.0-preview.7.24407.4

Affected platforms

Windows, I was not able test on other platforms

Affected platform versions

Windows SDK 10.0.19041

Did you find any workaround?

Nope.

Relevant log output

The message is logged with one character per line in the Web Dev Tools Debug console. It seems some dev debugging piece checked in.
@egvijayanand egvijayanand added the t/bug Something isn't working label Sep 11, 2024
egvijayanand added a commit to egvijayanand/maui-issue-24705 that referenced this issue Sep 11, 2024
egvijayanand added a commit to egvijayanand/maui-issue-24705 that referenced this issue Sep 11, 2024
@egvijayanand
Copy link
Contributor Author

Here's the link to the repository with a sample project to simulate this issue.

https://github.com/egvijayanand/maui-issue-24705

@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed i/regression This issue described a confirmed regression on a currently supported version labels Sep 11, 2024
@Zhanglirong-Winnie
Copy link

This issue has been verified using Visual Studio 17.12.0 Preview 2.0(9.0.0-rc.1.24453.9 & 9.0.0-preview.7.24407.4). Can repro on Windows platform. On 9.0.0-preview.7.24407.4 works fine.

@mattleibow
Copy link
Member

@Eilon thoughts?

@mattleibow mattleibow added area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/windows 🪟 labels Sep 11, 2024
@Eilon Eilon added area-controls-hybridwebview HybridWebView control and removed area-blazor Blazor Hybrid / Desktop, BlazorWebView labels Sep 11, 2024
@Eilon
Copy link
Member

Eilon commented Sep 11, 2024

Hi @egvijayanand , it's probably because the HybridWebView.js file is out-of-date. It changed significantly from preview7 to rc1.

In your app replace the contents of this file: https://github.com/egvijayanand/maui-issue-24705/blob/main/src/HwvApp/Resources/Raw/wwwroot/scripts/hwv.js

With this file: https://github.com/dotnet/maui/blob/release/9.0.1xx-rc1/src/Controls/samples/Controls.Sample/Resources/Raw/HybridSamplePage/scripts/HybridWebView.js

@Eilon Eilon closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
@egvijayanand
Copy link
Contributor Author

There's no mention about the modifications in the changelog?

Kindly include it here.

https://github.com/dotnet/core/blob/main/release-notes%2F9.0%2Fpreview%2Frc1%2Fdotnetmaui.md

And also suggest to pack the associated JS as an embedded resource like Blazor with a naming convention and a reference can be in the HTML file, so that it need not be looked into for every version.

@Eilon
Copy link
Member

Eilon commented Sep 11, 2024

Thanks @egvijayanand , I sent a PR here to update the notes: dotnet/core#9501

For embedding the JS file, that is unfortunately out of scope for .NET 9 right now but definitely something we'll look into in the future.

@egvijayanand
Copy link
Contributor Author

egvijayanand commented Sep 12, 2024

Cool, the release notes got updated.

#24730 - Logged as a feature request to track the JS as an embedded resource.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-hybridwebview HybridWebView control i/regression This issue described a confirmed regression on a currently supported version platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants