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

Cross-compile SignalR client libraries and enable platform compat ana… #26140

Merged
5 commits merged into from
Sep 23, 2020

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Sep 21, 2020

…lyzer

Contributes to #25917

@pranavkm pranavkm force-pushed the prkrishn/netcoreapp-client branch 2 times, most recently from df9b38e to 1438f75 Compare September 21, 2020 19:45
@pranavkm pranavkm marked this pull request as ready for review September 21, 2020 19:45
@pranavkm pranavkm requested a review from halter73 as a code owner September 21, 2020 19:45
@pranavkm pranavkm force-pushed the prkrishn/netcoreapp-client branch from 1438f75 to 876befa Compare September 21, 2020 21:27
// Set this header so the server auth middleware will set an Unauthorized instead of Redirect status code
// See: https://github.com/aspnet/Security/blob/ff9f145a8e89c9756ea12ff10c6d47f2f7eb345f/src/Microsoft.AspNetCore.Authentication.Cookies/Events/CookieAuthenticationEvents.cs#L42
#pragma warning disable CA1416 // Analyzer bug
Copy link
Member

Choose a reason for hiding this comment

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

Is there an issue related to the analyzer bug that we can link to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I was hoping this was the result of one of the SDK bugs that was already resolved.

@mavasani \ @buyaa-n any idea why this might be busted and how we could track this? I can't get a minimal app that reproduces the problem, but it is consistent in this branch of AspNetCore. I "updated" this branch to target 5.0.100-rc.2.20472.12 but that doesn't appear to help.

Choose a reason for hiding this comment

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

5.0.100-rc.2.20472.12

I am presuming this is the SDK version? Can you try the latest RC2 NuGet package: https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet5&package=Microsoft.CodeAnalysis.NetAnalyzers&protocolType=NuGet&version=5.0.0-rc2.20471.13&view=overview?

Can you also check if this repros if you replace the boolean check above with explicit OperatingSystem.IsBrowser() check? If that removes the false positive, then it is likely that something in flow analysis is causing the state stored in the bool to get lost before this if block. I can try to repro this later today.

Copy link

Choose a reason for hiding this comment

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

Surprsingly seems it is worked above on row 45 and 64, somehow working on off?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

No good. As @buyaa-n pointed out, the same check works in the ifs above, just not after the if block on line 52

@halter73
Copy link
Member

Do we need to update Protocols.MessagePack and Protocols.NewtonsoftJson to also target DefaultNetCoreTargetFramework?

@Pilchie Pilchie added the area-signalr Includes: SignalR clients and servers label Sep 22, 2020
@pranavkm pranavkm force-pushed the prkrishn/netcoreapp-client branch from 876befa to 998cc42 Compare September 22, 2020 23:01
@pranavkm pranavkm added this to the 6.0.0-alpha1 milestone Sep 22, 2020
{
var accessTokenEncoded = UrlEncoder.Default.Encode(accessToken);
accessTokenEncoded = "access_token=" + accessTokenEncoded;
resolvedUrl = Utils.AppendQueryString(resolvedUrl, accessTokenEncoded);
}
else
{
#pragma warning disable CA1416 // Analyzer bug
Copy link

@mavasani mavasani Sep 22, 2020

Choose a reason for hiding this comment

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

This feels surprising given you have an explicit OperatingSystem.IsBrowser() check in the if part. What are the platform attributes applied to Options and SetRequestHeader symbols?

Copy link

Choose a reason for hiding this comment

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

Seems [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
https://github.com/dotnet/runtime/pull/41963/files#diff-0f06b592b2ee5b30d95ae38efae16a85R49

@BrennanConroy
Copy link
Member

@pranavkm pranavkm force-pushed the prkrishn/netcoreapp-client branch from 44739f9 to f715aa5 Compare September 23, 2020 17:14
Copy link
Contributor Author

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

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

Next up add nullability to these types

@ghost
Copy link

ghost commented Sep 23, 2020

Hello @pranavkm!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants