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

Windows: Connectivity check sometimes return NetworkAccess.Unknown #17270

Closed
unombun opened this issue Sep 8, 2023 · 13 comments · Fixed by #19261
Closed

Windows: Connectivity check sometimes return NetworkAccess.Unknown #17270

unombun opened this issue Sep 8, 2023 · 13 comments · Fixed by #19261
Assignees
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info fixed-in-8.0.7 fixed-in-9.0.100-preview.1.9973 p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@unombun
Copy link

unombun commented Sep 8, 2023

Description

On Windows checking connectivity returns incorrect value of NetworkAccess.Unknown.

There is this already closed issue: #9972

But this for sure is not fixed because I can still reproduce it.

Steps to Reproduce

Here is the tricky part. I cannot provide any particular repro steps. In my app this can reproduce in some particular screens, in other happens only sometimes.

I tried create a demo sample app but I could not reproduce there.
Of course I tried calling on the main thread the check as a suggestions made in the #9972. But sometimes it works, sometimes not.

It happens also with .Net 8 - preview 7.8842

Link to public reproduction project repository

No sample

Version with bug

7.0.92

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

Exception thrown at 0x00007FFB8C31CF19 (KernelBase.dll) : The application called an interface that was marshalled for a different thread.
@unombun unombun added the t/bug Something isn't working label Sep 8, 2023
@mikeparker104 mikeparker104 added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label Sep 8, 2023
@samhouts
Copy link
Member

samhouts commented Sep 8, 2023

Thank you, we'll take a look at this. We'll see if we can come up with a reproduction on our side for now.

@jsuarezruiz jsuarezruiz added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label Sep 11, 2023
@BenBtg
Copy link
Contributor

BenBtg commented Sep 13, 2023

Repro sample confirmed in this repo https://github.com/breenbob/MauiWindowsConnectivityIssue

@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Sep 18, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Sep 21, 2023
@ghost
Copy link

ghost commented Sep 21, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@samhouts samhouts modified the milestones: Backlog, Under Consideration Oct 3, 2023
@jsuarezruiz
Copy link
Contributor

Related with microsoft/WindowsAppSDK#2965

@jsuarezruiz jsuarezruiz self-assigned this Oct 9, 2023
@jsuarezruiz jsuarezruiz moved this from Todo to In Progress in MAUI SDK Ongoing Oct 9, 2023
@samhouts samhouts modified the milestones: Under Consideration, .NET 8 SR1 Oct 9, 2023
@HelenMamalaki
Copy link

Copy of same comment posted #2965
I am having the same issue:
Target framework: net7.0-windows10.0.19041.0

  "Microsoft.Maui.Dependencies/6.0.312": {
    "type": "package",
    "dependencies": {
      "Microsoft.Graphics.Win2D": "1.0.3.1",
      "Microsoft.Maui.Graphics": "6.0.300",
      "Microsoft.Maui.Graphics.Win2D.WinUI.Desktop": "6.0.300",
      "Microsoft.WindowsAppSDK": "1.0.3"
    }

project.assets.json

Laptop running: Windows 10 Enterprise 19045.3570

I can't keep calling my fetch data API service on the Main thread as it blocks the UI thread - this seems like a major issue.
image

@Foda Foda self-assigned this Nov 2, 2023
@BenBtg
Copy link
Contributor

BenBtg commented Nov 27, 2023

I have a workaround for the above issue when checking Connecivity on Windows 10. Essentially you need to ensure all Connectivity checks are done on the Main thread. Example can seen here.
https://github.com/BenBtg/MauiWindowsConnectivityIssue/tree/workaround

@Foda
Copy link
Member

Foda commented Nov 29, 2023

Copy of same comment posted #2965 I am having the same issue: Target framework: net7.0-windows10.0.19041.0

  "Microsoft.Maui.Dependencies/6.0.312": {
    "type": "package",
    "dependencies": {
      "Microsoft.Graphics.Win2D": "1.0.3.1",
      "Microsoft.Maui.Graphics": "6.0.300",
      "Microsoft.Maui.Graphics.Win2D.WinUI.Desktop": "6.0.300",
      "Microsoft.WindowsAppSDK": "1.0.3"
    }

project.assets.json

Laptop running: Windows 10 Enterprise 19045.3570

I can't keep calling my fetch data API service on the Main thread as it blocks the UI thread - this seems like a major issue. image

Can you give me a small reproduceable sample? I'm having a difficult time with this on the latest version of the WinSDK + Maui

@damienaicheh
Copy link

Hi @Foda the repro sample provided above is not enough ? #17270 (comment) and this one https://github.com/breenbob/MauiWindowsConnectivityIssue

@Foda
Copy link
Member

Foda commented Nov 30, 2023

Hi @Foda the repro sample provided above is not enough ? #17270 (comment) and this one https://github.com/breenbob/MauiWindowsConnectivityIssue

I was unable to repro on Win11 on Maui 7 and Maui 8. I don't have a Win10 machine on-hand. Could you try upgrading to Maui 7 or 8 and see if the issue still happens on your machine?

@Redth Redth moved this from In Progress to To Move in MAUI SDK Ongoing Nov 30, 2023
@Redth Redth added the s/needs-info Issue needs more info from the author label Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 2023

Hi @unombun. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Redth Redth modified the milestones: .NET 8 SR1, .NET 8 SR2 Nov 30, 2023
@Redth Redth moved this from To Move to Todo in MAUI SDK Ongoing Nov 30, 2023
@Foda
Copy link
Member

Foda commented Dec 4, 2023

Update: finally able to repro on latest w/ Win10 :)

@Foda Foda moved this from Todo to In Progress in MAUI SDK Ongoing Dec 7, 2023
@ghost ghost added the s/no-recent-activity Issue has had no recent activity label Dec 8, 2023
@ghost
Copy link

ghost commented Dec 8, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@ghost ghost closed this as completed Dec 11, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in MAUI SDK Ongoing Dec 11, 2023
@samhouts samhouts reopened this Dec 11, 2023
@ghost ghost removed the s/no-recent-activity Issue has had no recent activity label Dec 11, 2023
@samhouts
Copy link
Member

bad bot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info fixed-in-8.0.7 fixed-in-9.0.100-preview.1.9973 p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/windows 🪟 t/bug Something isn't working
Projects
Status: Done
9 participants