Repository navigation
Corrupted pr 62755 20260125 8069 - #3
atakanserifoglu wants to merge 3 commits into
Conversation
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
|
❌ Sorry @atakanserifoglu, you do not have a seat in the organization Deeployed-Peer or the organization has no active subscription. Please contact your organization admin. |
WalkthroughThis PR removes obsolete APIs across ASP.NET Core Components, focusing on WebAssembly authentication, forms validation, and JS interop. Key deletions include Changes
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Auth as Authentication System
participant Forms as Forms Validation
participant JS as JS Interop
participant Router as Router
Dev->>Auth: Remove SignOutSessionStateManager dependency
Auth->>Auth: Use NavigateToLogout instead
Auth->>Auth: Update AccessTokenResult to use InteractiveRequestOptions
Auth->>Auth: Update AccessTokenNotAvailableException.Redirect()
Auth->>Auth: Remove obsolete RemoteAuthenticationService constructor
Dev->>Forms: Remove obsolete AddDataAnnotationsValidation
Forms->>Forms: Use EnableDataAnnotationsValidation with IServiceProvider
Dev->>JS: Remove obsolete InvokeJS<T0,T1,T2,TRes>
JS->>JS: Use InvokeJSJson with JSImport
Dev->>Router: Remove PreferExactMatches property
Dev->>Web: Remove RemoteBrowserFileStreamOptions
Web->>Web: Use RemoteJSDataStream defaults
Dev->>Web: Remove WebEventCallbackFactoryEventArgsExtensions
Web->>Web: Use generic EventCallbackFactory.Create<T>
Dev->>WebRenderer: Remove RendererId.init accessor
WebRenderer->>WebRenderer: Use GetWebRendererId override
Dev->>JSInteropMethods: Remove NotifyLocationChanged(string,bool)
JSInteropMethods->>JSInteropMethods: Use string? state overload
|
There was a problem hiding this comment.
Commits
Files that changed from the base of the PR and between Base and fec6351 commits: 20Files Selected For Review: 15
- src/Components/Components/src/Routing/Router.cs with diff length 657.
- src/Components/Forms/src/EditContextDataAnnotationsExtensions.cs with diff length 1410.
- src/Components/Forms/test/EditContextDataAnnotationsExtensionsTest.cs with diff length 523.
- src/Components/Web/src/Forms/InputFile/RemoteBrowserFileStreamOptions.cs with diff length 1460.
- src/Components/Web/src/Web/WebEventCallbackFactoryEventArgsExtensions.cs with diff length 17357.
- src/Components/Web/src/WebRenderer.cs with diff length 263.
- src/Components/WebAssembly/JSInterop/src/InternalCalls.cs with diff length 1105.
- src/Components/WebAssembly/WebAssembly.Authentication/src/RemoteAuthenticatorViewCore.cs with diff length 1805.
- src/Components/WebAssembly/WebAssembly.Authentication/src/Services/AccessTokenNotAvailableException.cs with diff length 709.
- src/Components/WebAssembly/WebAssembly.Authentication/src/Services/AccessTokenResult.cs with diff length 1647.
- src/Components/WebAssembly/WebAssembly.Authentication/src/Services/RemoteAuthenticationService.cs with diff length 1543.
- src/Components/WebAssembly/WebAssembly.Authentication/src/Services/SignOutSessionStateManager.cs with diff length 3808.
- src/Components/WebAssembly/WebAssembly.Authentication/src/WebAssemblyAuthenticationServiceCollectionExtensions.cs with diff length 681.
- src/Components/WebAssembly/WebAssembly.Authentication/test/RemoteAuthenticatorCoreTests.cs with diff length 2905.
- src/Components/WebAssembly/WebAssembly/src/Infrastructure/JSInteropMethods.cs with diff length 596.
Files excluded from review due to unsupported file extensions: 5
- src/Components/Components/src/PublicAPI.Unshipped.txt
- src/Components/Forms/src/PublicAPI.Unshipped.txt
- src/Components/Web/src/PublicAPI.Unshipped.txt
- src/Components/WebAssembly/WebAssembly.Authentication/src/PublicAPI.Unshipped.txt
- src/Components/WebAssembly/WebAssembly/src/PublicAPI.Unshipped.txt
Review comments generated: (12)
- Review: 2
- LGTM: 10
- Identified issue already discussed: 0
Tips
Chat with Deeployed Bot (@deeployed-peer)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@deeployed-peerin a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@deeployed-peer: ignoreanywhere in the PR description to pause further reviews from the bot.
| /// </summary> | ||
| public void Redirect() | ||
| { | ||
| if (_tokenResult.InteractionOptions != null && _tokenResult.InteractiveRequestUrl != null) | ||
| if (_tokenResult.InteractionOptions != null) | ||
| { | ||
| _navigation.NavigateToLogin(_tokenResult.InteractiveRequestUrl, _tokenResult.InteractionOptions); | ||
| } | ||
| else | ||
| { | ||
| #pragma warning disable CS0618 // Type or member is obsolete | ||
| _navigation.NavigateTo(_tokenResult.RedirectUrl!); | ||
| #pragma warning restore CS0618 // Type or member is obsolete | ||
| _navigation.NavigateTo(_tokenResult.InteractiveRequestUrl!); | ||
| } | ||
| } |
There was a problem hiding this comment.
🟠 High: The null-conditional check && _tokenResult.InteractiveRequestUrl != null was incorrectly removed from the condition. The original code only called NavigateToLogin when BOTH InteractionOptions AND InteractiveRequestUrl were non-null. The new code only checks InteractionOptions != null, which means if InteractionOptions is non-null but InteractiveRequestUrl is null, it will pass a null InteractiveRequestUrl to NavigateToLogin, likely causing a runtime exception. The null check on InteractiveRequestUrl should be preserved.
| /// </summary> | |
| public void Redirect() | |
| { | |
| if (_tokenResult.InteractionOptions != null && _tokenResult.InteractiveRequestUrl != null) | |
| if (_tokenResult.InteractionOptions != null) | |
| { | |
| _navigation.NavigateToLogin(_tokenResult.InteractiveRequestUrl, _tokenResult.InteractionOptions); | |
| } | |
| else | |
| { | |
| #pragma warning disable CS0618 // Type or member is obsolete | |
| _navigation.NavigateTo(_tokenResult.RedirectUrl!); | |
| #pragma warning restore CS0618 // Type or member is obsolete | |
| _navigation.NavigateTo(_tokenResult.InteractiveRequestUrl!); | |
| } | |
| } | |
| /// </summary> | |
| public void Redirect() | |
| { | |
| if (_tokenResult.InteractionOptions != null && _tokenResult.InteractiveRequestUrl != null) | |
| { | |
| _navigation.NavigateToLogin(_tokenResult.InteractiveRequestUrl, _tokenResult.InteractionOptions); | |
| } | |
| else | |
| { | |
| _navigation.NavigateTo(_tokenResult.InteractiveRequestUrl!); | |
| } | |
| } |
| private async Task ProcessLogOut(string returnUrl) | ||
| { | ||
| if ((Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()) || | ||
| // For backcompat purposes, keep SignOutManager working, even though we now use the history.state for this. | ||
| (Navigation.HistoryEntryState == null && !await SignOutManager.ValidateSignOutState())) | ||
| if (!ValidateSignOutRequestState()) | ||
| { | ||
| Log.LogoutOperationInitiatedExternally(Logger); | ||
| Navigation.NavigateTo(ApplicationPaths.LogOutFailedPath, AuthenticationNavigationOptions with { HistoryEntryState = "The logout was not initiated from within the page." }); |
There was a problem hiding this comment.
🟠 High: The new validation logic if (!ValidateSignOutRequestState()) is incomplete compared to the old logic. The old code had two conditions:
Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()- fail if state exists but is invalidNavigation.HistoryEntryState == null && !await SignOutManager.ValidateSignOutState()- fallback to legacy validation when no state
The new code only checks !ValidateSignOutRequestState(), which means it will incorrectly fail validation when HistoryEntryState is null (no state), whereas the old logic would pass in that case (assuming the legacy SignOutManager check passed).
The PR description mentions "only fail validation when state exists but is invalid", but the implementation doesn't match this - it fails when state is null OR invalid. The condition should be if (Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()) to properly implement the described behavior.
| private async Task ProcessLogOut(string returnUrl) | |
| { | |
| if ((Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()) || | |
| // For backcompat purposes, keep SignOutManager working, even though we now use the history.state for this. | |
| (Navigation.HistoryEntryState == null && !await SignOutManager.ValidateSignOutState())) | |
| if (!ValidateSignOutRequestState()) | |
| { | |
| Log.LogoutOperationInitiatedExternally(Logger); | |
| Navigation.NavigateTo(ApplicationPaths.LogOutFailedPath, AuthenticationNavigationOptions with { HistoryEntryState = "The logout was not initiated from within the page." }); | |
| private async Task ProcessLogOut(string returnUrl) | |
| { | |
| if (Navigation.HistoryEntryState != null && !ValidateSignOutRequestState()) | |
| { | |
| Log.LogoutOperationInitiatedExternally(Logger); | |
| Navigation.NavigateTo(ApplicationPaths.LogOutFailedPath, AuthenticationNavigationOptions with { HistoryEntryState = "The logout was not initiated from within the page." }); |
| public void Redirect() | ||
| { | ||
| if (_tokenResult.InteractionOptions != null && _tokenResult.InteractiveRequestUrl != null) | ||
| if (_tokenResult.InteractionOptions != null) |
There was a problem hiding this comment.
it should be when null
Elevate your code reviews with Deeployed Peer
| if (_tokenResult.InteractionOptions != null) | |
| if (_tokenResult.InteractionOptions == null) |
atakanserifoglu
left a comment
There was a problem hiding this comment.
@deeployed-peer-dev
✅ Conditional approval has been given. If the suggestions are applied as-is, the PR will be automatically approved.
|
@atakanserifoglu You are not authorized to approve this PR. Conditional approval cancelled. |
Code Review Bench PR dotnet#62755
Original PR Title: [Blazor] Remove obsolete APIs from Components
Original PR Description: This PR removes obsolete APIs from the Blazor Components library that were marked as obsolete, as per the project's obsolete API removal policy.
Description
Components (Microsoft.AspNetCore.Components)
PreferExactMatchesproperty from Router which was marked obsolete and had no effect on routing behaviorResourceAssetconstructor overloadForms (Microsoft.AspNetCore.Components.Forms)
AddDataAnnotationsValidationmethod (replaced byEnableDataAnnotationsValidation)EnableDataAnnotationsValidation(EditContext)overload without IServiceProvider parameterWeb (Microsoft.AspNetCore.Components.Web)
RemoteBrowserFileStreamOptionsclassWebEventCallbackFactoryEventArgsExtensionsclass and all its methodsRendererId.initaccessor fromWebRendererWebAssembly (Microsoft.AspNetCore.Components.WebAssembly)
NotifyLocationChanged(string, bool)method fromJSInteropMethodsWebAssembly.Authentication (Microsoft.AspNetCore.Components.WebAssembly.Authentication)
SignOutSessionStateManagerclass and all referencesRemoteAuthenticationServiceconstructor without logger parameterAccessTokenResultconstructor andRedirectUrlpropertyAccessTokenNotAvailableExceptionto useInteractiveRequestUrlinstead of removedRedirectUrlRemoteAuthenticatorViewCoresign-out validation logic to properly handle nullHistoryEntryState(only fail validation when state exists but is invalid)API Surface
PublicAPI.Shipped.txtfiles remain unchanged per API baseline policy*REMOVED*entries to correspondingPublicAPI.Unshipped.txtfiles for all removed APIsTests
SignOutSessionStateManager,AddDataAnnotationsValidation)Validation
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Original PR URL: dotnet#62755