Skip to content

Corrupted pr 62755 20260125 8069 - #2

Closed
atakanserifoglu wants to merge 3 commits into
base_pr_62755_20260125_8069from
corrupted_pr_62755_20260125_8069
Closed

atakanserifoglu wants to merge 3 commits into
base_pr_62755_20260125_8069from
corrupted_pr_62755_20260125_8069

Conversation

@atakanserifoglu

Copy link
Copy Markdown

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.

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Description

Components (Microsoft.AspNetCore.Components)

  • Removed the PreferExactMatches property from Router which was marked obsolete and had no effect on routing behavior
  • Removed obsolete ResourceAsset constructor overload

Forms (Microsoft.AspNetCore.Components.Forms)

  • Removed the AddDataAnnotationsValidation method (replaced by EnableDataAnnotationsValidation)
  • Removed the obsolete EnableDataAnnotationsValidation(EditContext) overload without IServiceProvider parameter

Web (Microsoft.AspNetCore.Components.Web)

  • Removed the obsolete RemoteBrowserFileStreamOptions class
  • Removed the obsolete WebEventCallbackFactoryEventArgsExtensions class and all its methods
  • Removed the obsolete RendererId.init accessor from WebRenderer

WebAssembly (Microsoft.AspNetCore.Components.WebAssembly)

  • Removed obsolete NotifyLocationChanged(string, bool) method from JSInteropMethods

WebAssembly.Authentication (Microsoft.AspNetCore.Components.WebAssembly.Authentication)

  • Removed the obsolete SignOutSessionStateManager class and all references
  • Removed obsolete RemoteAuthenticationService constructor without logger parameter
  • Removed obsolete AccessTokenResult constructor and RedirectUrl property
  • Updated AccessTokenNotAvailableException to use InteractiveRequestUrl instead of removed RedirectUrl
  • Updated RemoteAuthenticatorViewCore sign-out validation logic to properly handle null HistoryEntryState (only fail validation when state exists but is invalid)

API Surface

  • All PublicAPI.Shipped.txt files remain unchanged per API baseline policy
  • Added *REMOVED* entries to corresponding PublicAPI.Unshipped.txt files for all removed APIs

Tests

  • Removed tests that were using obsolete APIs (SignOutSessionStateManager, AddDataAnnotationsValidation)

Validation

  • ✅ All builds pass successfully
  • ✅ All existing tests continue to pass
  • ✅ No breaking changes to non-obsolete functionality
  • ✅ Code follows project formatting standards
  • ✅ API baseline policy followed correctly

💡 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

@deeployed-peer

Copy link
Copy Markdown

❌ 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.

@deeployed-peer-dev

deeployed-peer-dev Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Walkthrough

This PR removes obsolete APIs across ASP.NET Core Components, focusing on WebAssembly authentication, JS interop, routing, and forms validation. Changes include eliminating deprecated properties, methods, constructors, and entire classes that were marked obsolete, streamlining the API surface and reducing maintenance burden.

Changes
Files Summary
WebRenderer.cs Removed obsolete RendererId.init accessor; property now getter-only
JSInteropMethods.cs Removed obsolete NotifyLocationChanged(string, bool) overload; retained overload with HistoryEntryState
WebAssemblyAuthenticationServiceCollectionExtensions.cs, SignOutSessionStateManager.cs, RemoteAuthenticatorViewCore.cs, RemoteAuthenticatorCoreTests.cs Removed obsolete SignOutSessionStateManager class and all references; updated DI registration, authentication logic, and tests
EditContextDataAnnotationsExtensions.cs, EditContextDataAnnotationsExtensionsTest.cs Removed obsolete AddDataAnnotationsValidation method and parameterless EnableDataAnnotationsValidation overload; removed chaining test
AccessTokenResult.cs, AccessTokenNotAvailableException.cs Removed obsolete RedirectUrl property and 3-parameter constructor; updated Redirect() to use InteractiveRequestUrl
Router.cs Removed obsolete non-functional PreferExactMatches property
InternalCalls.cs Removed obsolete InvokeJS<T0, T1, T2, TRes> method; retained JSImport-based InvokeJSJson
RemoteAuthenticationService.cs Removed obsolete constructor overload lacking ILogger parameter
RemoteBrowserFileStreamOptions.cs Removed obsolete RemoteBrowserFileStreamOptions class and SignalR-related configuration properties
WebEventCallbackFactoryEventArgsExtensions.cs Removed obsolete WebEventCallbackFactoryEventArgsExtensions class with 22 web-specific EventCallbackFactory extension methods
Sequence Diagram
sequenceDiagram
    participant Dev as Developer
    participant PR as Pull Request
    participant Auth as Authentication Services
    participant Forms as Forms/Validation
    participant Routing as Routing
    participant JSInterop as JS Interop
    participant Web as Web Components

    Dev->>PR: Submit obsolete API removal
    PR->>Auth: Remove SignOutSessionStateManager
    Auth->>Auth: Update RemoteAuthenticatorViewCore<br/>to use ValidateSignOutRequestState()
    Auth->>Auth: Remove AccessTokenResult.RedirectUrl<br/>and obsolete constructor
    Auth->>Auth: Remove RemoteAuthenticationService<br/>constructor without ILogger
    
    PR->>Forms: Remove obsolete validation methods
    Forms->>Forms: Keep EnableDataAnnotationsValidation<br/>(with IServiceProvider)
    
    PR->>Routing: Remove PreferExactMatches property
    
    PR->>JSInterop: Remove InvokeJS<T0,T1,T2,TRes>
    JSInterop->>JSInterop: Retain InvokeJSJson (JSImport)
    
    PR->>Web: Remove WebRenderer.RendererId setter
    PR->>Web: Remove RemoteBrowserFileStreamOptions
    PR->>Web: Remove WebEventCallbackFactoryEventArgsExtensions
    
    PR->>Dev: All obsolete APIs removed<br/>Tests updated and passing
Loading

Uplevel your code reviews with Deeployed Peer!

@deeployed-peer-dev deeployed-peer-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Commits Files that changed from the base of the PR and between Base and fec6351 commits: 20
Files 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-peer in 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: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines 35 to 46
/// </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!);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Critical: The new code has a logic error: the if condition was removed but the braces remain, causing the NavigateToLogin call to always execute unconditionally. The condition if (_tokenResult.InteractionOptions != null) needs to be restored before the opening brace.

Suggested change
/// </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!);
}
}

Comment on lines 279 to 284
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." });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High: The new validation logic if (!ValidateSignOutRequestState()) is a breaking change from the original behavior. The old code only failed validation when Navigation.HistoryEntryState != null AND validation failed, OR when HistoryEntryState == null AND the legacy SignOutManager.ValidateSignOutState() failed. The new code fails validation whenever ValidateSignOutRequestState() returns false, which happens when GetCachedNavigationState()?.Interaction != InteractionType.SignOut. This means if HistoryEntryState is null (no cached state), GetCachedNavigationState() likely returns null, making the condition null?.Interaction == InteractionType.SignOut evaluate to false, causing validation to fail. This contradicts the PR description which states: "only fail validation when state exists but is invalid". The logic should preserve the null-state pass-through behavior.

Suggested change
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)
{
var cachedState = GetCachedNavigationState();
if (cachedState != null && cachedState.Interaction != InteractionType.SignOut)
{
Log.LogoutOperationInitiatedExternally(Logger);
Navigation.NavigateTo(ApplicationPaths.LogOutFailedPath, AuthenticationNavigationOptions with { HistoryEntryState = "The logout was not initiated from within the page." });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants