Skip to content

Commit 95a6473

Browse files
committed
Rename the feature switch to IsCustomAwaitableSupported to align with other feature switch naming
1 parent 89d363b commit 95a6473

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ internal sealed partial class DefaultHubDispatcher<[DynamicallyAccessedMembers(H
3232
private readonly Func<HubLifetimeContext, Exception?, Task>? _onDisconnectedMiddleware;
3333
private readonly HubLifetimeManager<THub> _hubLifetimeManager;
3434

35-
[FeatureSwitchDefinition("Microsoft.AspNetCore.SignalR.Hub.CustomAwaitableSupport")]
35+
[FeatureSwitchDefinition("Microsoft.AspNetCore.SignalR.Hub.IsCustomAwaitableSupported")]
3636
[FeatureGuard(typeof(RequiresDynamicCodeAttribute))]
3737
[FeatureGuard(typeof(RequiresUnreferencedCodeAttribute))]
38-
private static bool CustomAwaitableSupport { get; } =
39-
AppContext.TryGetSwitch("Microsoft.AspNetCore.SignalR.Hub.CustomAwaitableSupport", out bool customAwaitableSupport) ? customAwaitableSupport : true;
38+
private static bool IsCustomAwaitableSupported { get; } =
39+
AppContext.TryGetSwitch("Microsoft.AspNetCore.SignalR.Hub.IsCustomAwaitableSupported", out bool customAwaitableSupport) ? customAwaitableSupport : true;
4040

4141
public DefaultHubDispatcher(IServiceScopeFactory serviceScopeFactory, IHubContext<THub> hubContext, bool enableDetailedErrors,
4242
bool disableImplicitFromServiceParameters, ILogger<DefaultHubDispatcher<THub>> logger, List<IHubFilter>? hubFilters, HubLifetimeManager<THub> lifetimeManager)
@@ -768,7 +768,7 @@ private void DiscoverHubMethods(bool disableImplicitFromServiceParameters)
768768
throw new NotSupportedException($"Duplicate definitions of '{methodName}'. Overloading is not supported.");
769769
}
770770

771-
var executor = CustomAwaitableSupport
771+
var executor = IsCustomAwaitableSupported
772772
? CreateObjectMethodExecutor(methodInfo, hubTypeInfo)
773773
: ObjectMethodExecutor.CreateTrimAotCompatible(methodInfo, hubTypeInfo);
774774

@@ -780,8 +780,8 @@ private void DiscoverHubMethods(bool disableImplicitFromServiceParameters)
780780
}
781781
}
782782

783-
[RequiresUnreferencedCode("Using SignalR with 'Microsoft.AspNetCore.SignalR.Hub.CustomAwaitableSupport=true' is not trim compatible.")]
784-
[RequiresDynamicCode("Using SignalR with 'Microsoft.AspNetCore.SignalR.Hub.CustomAwaitableSupport=true' is not native AOT compatible.")]
783+
[RequiresUnreferencedCode("Using SignalR with 'Microsoft.AspNetCore.SignalR.Hub.IsCustomAwaitableSupported=true' is not trim compatible.")]
784+
[RequiresDynamicCode("Using SignalR with 'Microsoft.AspNetCore.SignalR.Hub.IsCustomAwaitableSupported=true' is not native AOT compatible.")]
785785
private static ObjectMethodExecutor CreateObjectMethodExecutor(MethodInfo methodInfo, TypeInfo targetType)
786786
=> ObjectMethodExecutor.Create(methodInfo, targetType);
787787

src/SignalR/server/Core/src/Microsoft.AspNetCore.SignalR.Core.WarningSuppressions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<argument>IL2026</argument>
77
<property name="Scope">member</property>
88
<property name="Target">M:Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.DiscoverHubMethods(System.Boolean)</property>
9-
<property name="Justification">This warning is left in the product so developers get an ILLink warning when trimming an app when Microsoft.AspNetCore.SignalR.Hub.CustomAwaitableSupport=true.</property>
9+
<property name="Justification">This warning is left in the product so developers get an ILLink warning when trimming an app when Microsoft.AspNetCore.SignalR.Hub.IsCustomAwaitableSupported=true.</property>
1010
</attribute>
1111
</assembly>
1212
</linker>

src/SignalR/server/SignalR/test/Microsoft.AspNetCore.SignalR.Tests/NativeAotTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private static void RunNativeAotTest(Func<Task> test)
120120
{
121121
var options = new RemoteInvokeOptions();
122122
options.RuntimeConfigurationOptions.Add("System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported", "false");
123-
options.RuntimeConfigurationOptions.Add("Microsoft.AspNetCore.SignalR.Hub.CustomAwaitableSupport", "false");
123+
options.RuntimeConfigurationOptions.Add("Microsoft.AspNetCore.SignalR.Hub.IsCustomAwaitableSupported", "false");
124124
options.RuntimeConfigurationOptions.Add("System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault", "false");
125125

126126
using var remoteHandle = RemoteExecutor.Invoke(test, options);

src/SignalR/server/SignalR/test/Microsoft.AspNetCore.SignalR.TrimmingTests/Microsoft.AspNetCore.SignalR.TrimmingTests.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<ItemGroup>
44
<TestConsoleAppSourceFiles Include="TestTypedClients.cs">
5-
<DisabledFeatureSwitches>Microsoft.AspNetCore.SignalR.Hub.CustomAwaitableSupport</DisabledFeatureSwitches>
5+
<DisabledFeatureSwitches>Microsoft.AspNetCore.SignalR.Hub.IsCustomAwaitableSupported</DisabledFeatureSwitches>
66
</TestConsoleAppSourceFiles>
77
</ItemGroup>
88

0 commit comments

Comments
 (0)