-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Preserve RemoteAuthenticationContext during JS interop #54225
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet-issue-labeler
bot
added
the
area-blazor
Includes: Blazor, Razor Components
label
Feb 26, 2024
javiercn
approved these changes
Feb 26, 2024
This was referenced Feb 26, 2024
1 task
dotnet-policy-service
bot
added
the
pending-ci-rerun
When assigned to a PR indicates that the CI checks should be rerun
label
Mar 6, 2024
1 task
javiercn
approved these changes
Mar 14, 2024
halter73
force-pushed
the
halter73/49956
branch
from
March 19, 2024 02:06
25bcd7f
to
85e61c5
Compare
halter73
removed
the
pending-ci-rerun
When assigned to a PR indicates that the CI checks should be rerun
label
Mar 19, 2024
javiercn
reviewed
Mar 20, 2024
...st/testassets/Components.WasmRemoteAuthentication/Components.WasmRemoteAuthentication.csproj
Show resolved
Hide resolved
javiercn
approved these changes
Mar 20, 2024
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/aspnetcore/actions/runs/8367248800 |
@halter73 backporting to release/8.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Preserve RemoteAuthenticationContext during JS interop
Applying: Add trimmed E2E RemoteAuthenticationTest
Using index info to reconstruct a base tree...
M AspNetCore.sln
M src/Components/Components.slnf
M src/Components/test/E2ETest/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs
M src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj
M src/Components/test/E2ETest/Tests/WebAssemblyPrerenderedTest.cs
M src/Components/test/testassets/Components.TestServer/Components.TestServer.csproj
M src/Components/test/testassets/Components.TestServer/Program.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Components/test/testassets/Components.TestServer/Program.cs
Auto-merging src/Components/test/testassets/Components.TestServer/Components.TestServer.csproj
Auto-merging src/Components/test/E2ETest/Tests/WebAssemblyPrerenderedTest.cs
Auto-merging src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj
CONFLICT (content): Merge conflict in src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj
Auto-merging src/Components/test/E2ETest/Infrastructure/ServerFixtures/AspNetSiteServerFixture.cs
Auto-merging src/Components/Components.slnf
CONFLICT (content): Merge conflict in src/Components/Components.slnf
Auto-merging AspNetCore.sln
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Add trimmed E2E RemoteAuthenticationTest
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@halter73 an error occurred while backporting to release/8.0, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
halter73
added a commit
that referenced
this pull request
Mar 21, 2024
Merged
10 tasks
wtgodbe
pushed a commit
that referenced
this pull request
Apr 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Preserve
RemoteAuthenticationContext
from Microsoft.AspNetCore.Components.WebAssembly.Authentication during JS interop in order to avoid errors during sign in and sign out like "There was an error trying to log you in: '"undefined" is not valid JSON'".This didn't produce trim warnings because JSRuntime suppresses them. #39839 tracks adding trim-safe JSRuntime APIs.
I tried the suggested fix in #53819, but that did not fix the issue because type-level
[DynamicallyAccessedMembers]
only helps if something callsRemoteAuthenticationContext.GetType()
. It does not mean if any part of the type is preserved, preserve all parts of the type. You can look dotnet/linker#1196, dotnet/runtime#49465, and dotnet/linker#1929 for the original motivation and test cases that were added when[DynamicallyAccessedMembers]
was first allowed to target classes. The reason that it appeared to work with theDemoRemoteAuthenticationContextWithAttribute
test case is because Blazor does not trim application assemblies by default. If you trim the application assembly, you will see the same issue.Fixes #49956
Fixes #52291
Fixes #52619
Fixes #53131
Fixes #53409