1 write to InvocationId
Microsoft.AspNetCore.SignalR.Common (1)
Protocol\HubInvocationMessage.cs (1)
29
InvocationId
= invocationId;
108 references to InvocationId
Microsoft.AspNetCore.Components.Server (6)
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (6)
431
if (string.IsNullOrEmpty(message.
InvocationId
))
437
writer.Write(message.
InvocationId
);
463
writer.Write(message.
InvocationId
);
487
writer.Write(message.
InvocationId
);
535
writer.Write(message.
InvocationId
);
553
writer.Write(message.
InvocationId
);
Microsoft.AspNetCore.SignalR.Client.Core (19)
HubConnection.cs (17)
1477
Log.ArgumentBindingFailure(_logger, bindingFailure.
InvocationId
, bindingFailure.Target, bindingFailure.BindingFailure.SourceException);
1479
if (!string.IsNullOrEmpty(bindingFailure.
InvocationId
))
1481
await SendWithLock(connectionState, CompletionMessage.WithError(bindingFailure.
InvocationId
, "Client failed to parse argument(s)."), cancellationToken: default).ConfigureAwait(false);
1489
Log.ReceivedInvocation(_logger, invocation.
InvocationId
, invocation.Target, invocation.Arguments);
1493
if (!connectionState.TryRemoveInvocation(completion.
InvocationId
!, out irq))
1495
Log.DroppedCompletionMessage(_logger, completion.
InvocationId
!);
1505
if (!connectionState.TryGetInvocation(streamItem.
InvocationId
!, out irq))
1507
Log.DroppedStreamMessage(_logger, streamItem.
InvocationId
!);
1550
var expectsResult = !string.IsNullOrEmpty(invocation.
InvocationId
);
1559
await SendWithLock(connectionState, CompletionMessage.WithError(invocation.
InvocationId
!, "Client didn't provide a result."), cancellationToken: default).ConfigureAwait(false);
1563
Log.ErrorSendingInvocationResult(_logger, invocation.
InvocationId
!, invocation.Target, ex);
1609
await SendWithLock(connectionState, CompletionMessage.WithError(invocation.
InvocationId
!, resultException.Message), cancellationToken: default).ConfigureAwait(false);
1613
await SendWithLock(connectionState, CompletionMessage.WithResult(invocation.
InvocationId
!, result), cancellationToken: default).ConfigureAwait(false);
1618
await SendWithLock(connectionState, CompletionMessage.WithError(invocation.
InvocationId
!, "Client didn't provide a result."), cancellationToken: default).ConfigureAwait(false);
1623
Log.ErrorSendingInvocationResult(_logger, invocation.
InvocationId
!, invocation.Target, ex);
1800
if (string.IsNullOrEmpty(invocationMessage.
InvocationId
))
2501
Log.DroppingMessage(_logger, ((HubInvocationMessage)message).GetType().Name, ((HubInvocationMessage)message).
InvocationId
);
HubConnection.Log.cs (2)
42
SendingMessage(logger, message.GetType().Name, invocationMessage.
InvocationId
);
63
MessageSent(logger, message.GetType().Name, invocationMessage.
InvocationId
);
Microsoft.AspNetCore.SignalR.Common (8)
Protocol\CompletionMessage.cs (2)
54
return $"Completion {{ {nameof(
InvocationId
)}: \"{
InvocationId
}\", {nameof(Error)}: {errorStr}{resultField} }}";
Protocol\HubMethodInvocationMessage.cs (4)
120
return $"InvocationMessage {{ {nameof(
InvocationId
)}: \"{
InvocationId
}\", {nameof(Target)}: \"{Target}\", {nameof(Arguments)}: [ {args} ], {nameof(StreamIds)}: [ {streamIds} ] }}";
175
return $"StreamInvocation {{ {nameof(
InvocationId
)}: \"{
InvocationId
}\", {nameof(Target)}: \"{Target}\", {nameof(Arguments)}: [ {args} ], {nameof(StreamIds)}: [ {streamIds} ] }}";
Protocol\StreamItemMessage.cs (2)
29
return $"StreamItem {{ {nameof(
InvocationId
)}: \"{
InvocationId
}\", {nameof(Item)}: {Item ?? "<<null>>"} }}";
Microsoft.AspNetCore.SignalR.Core (35)
Internal\DefaultHubDispatcher.cs (27)
208
Log.DroppingMessage(_logger, hubMessage.GetType().Name, (hubMessage as HubInvocationMessage)?.
InvocationId
?? "(null)");
231
if (connection.ActiveRequestCancellationSources.TryGetValue(cancelInvocationMessage.
InvocationId
!, out var cts))
233
Log.CancelInvocation(_logger, cancelInvocationMessage.
InvocationId
!);
239
Log.UnexpectedCancelWithId(_logger, cancelInvocationMessage.
InvocationId
!);
258
else if (_hubLifetimeManager.TryGetReturnType(completionMessage.
InvocationId
!, out _))
264
Log.UnexpectedCompletion(_logger, completionMessage.
InvocationId
!);
296
return SendInvocationError(bindingFailureMessage.
InvocationId
, connection, errorMessage);
334
if (!string.IsNullOrEmpty(hubMethodInvocationMessage.
InvocationId
))
338
hubMethodInvocationMessage.
InvocationId
, $"Unknown hub method '{hubMethodInvocationMessage.Target}'")).AsTask();
382
await SendInvocationError(hubMethodInvocationMessage.
InvocationId
, connection,
400
await SendInvocationError(hubMethodInvocationMessage.
InvocationId
, connection,
426
_ = StreamAsync(hubMethodInvocationMessage.
InvocationId
!, connection, hubCallerContext,
460
if (cts != null && !string.IsNullOrEmpty(hubMethodInvocationMessage.
InvocationId
))
462
if (!connection.ActiveRequestCancellationSources.TryAdd(hubMethodInvocationMessage.
InvocationId
!, cts))
464
Log.InvocationIdInUse(logger, hubMethodInvocationMessage.
InvocationId
);
465
await SendInvocationError(hubMethodInvocationMessage.
InvocationId
, connection,
466
$"Invocation ID '{hubMethodInvocationMessage.
InvocationId
}' is already in use.");
478
Log.SendingResult(logger, hubMethodInvocationMessage.
InvocationId
, methodExecutor);
485
await SendInvocationError(hubMethodInvocationMessage.
InvocationId
, connection,
502
connection.ActiveRequestCancellationSources.TryRemove(hubMethodInvocationMessage.
InvocationId
!, out _);
517
if (!string.IsNullOrEmpty(hubMethodInvocationMessage.
InvocationId
))
520
await connection.WriteAsync(CompletionMessage.WithResult(hubMethodInvocationMessage.
InvocationId
, result));
542
await SendInvocationError(hubMethodInvocationMessage.
InvocationId
, connection,
548
await SendInvocationError(hubMethodInvocationMessage.
InvocationId
, connection,
797
if (!string.IsNullOrEmpty(hubMethodInvocationMessage.
InvocationId
))
800
await connection.WriteAsync(CompletionMessage.WithError(hubMethodInvocationMessage.
InvocationId
,
810
await connection.WriteAsync(CompletionMessage.WithError(hubMethodInvocationMessage.
InvocationId
!,
Internal\DefaultHubDispatcherLog.cs (3)
75
=> ReceivedStreamItem(logger, message.
InvocationId
);
84
=> CompletingStream(logger, message.
InvocationId
);
90
=> ClosingStreamWithBindingError(logger, message.
InvocationId
, message.Error);
src\aspnetcore\src\SignalR\common\Shared\ClientResultsManager.cs (3)
54
if (_pendingInvocations.TryGetValue(message.
InvocationId
!, out var item))
58
throw new InvalidOperationException($"Connection ID '{connectionId}' is not valid for invocation ID '{message.
InvocationId
}'.");
64
if (_pendingInvocations.Remove(message.
InvocationId
!, out _))
StreamTracker.cs (2)
54
if (TryGetConverter(message.
InvocationId
!, out var converter))
76
_lookup.TryRemove(message.
InvocationId
!, out var converter);
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
717
if (!string.IsNullOrEmpty(message.
InvocationId
))
719
writer.WriteString(InvocationIdPropertyNameBytes, message.
InvocationId
);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (6)
Protocol\MessagePackHubProtocolWorker.cs (6)
431
if (string.IsNullOrEmpty(message.
InvocationId
))
437
writer.Write(message.
InvocationId
);
463
writer.Write(message.
InvocationId
);
487
writer.Write(message.
InvocationId
);
535
writer.Write(message.
InvocationId
);
553
writer.Write(message.
InvocationId
);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
696
if (!string.IsNullOrEmpty(message.
InvocationId
))
699
writer.WriteValue(message.
InvocationId
);
Microsoft.AspNetCore.SignalR.Specification.Tests (24)
HubLifetimeManagerTestBase.cs (11)
191
Assert.NotNull(invocation.
InvocationId
);
194
await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.
InvocationId
, 10)).DefaultTimeout();
218
Assert.NotNull(invocation.
InvocationId
);
221
await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithError(invocation.
InvocationId
, "Error from client")).DefaultTimeout();
248
Assert.NotNull(invocation.
InvocationId
);
252
manager.SetConnectionResultAsync(connection2.ConnectionId, CompletionMessage.WithError(invocation.
InvocationId
, "Error from client"))).DefaultTimeout();
254
Assert.Equal($"Connection ID '{connection2.ConnectionId}' is not valid for invocation ID '{invocation.
InvocationId
}'.", ex.Message);
257
await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.
InvocationId
, 10)).DefaultTimeout();
307
await manager1.SetConnectionResultAsync(connection2.ConnectionId, CompletionMessage.WithError(invocation2.
InvocationId
, "error"));
312
await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation1.
InvocationId
, 3));
365
await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation1.
InvocationId
, 1));
ScaleoutHubLifetimeManagerTests.cs (10)
487
Assert.NotNull(invocation.
InvocationId
);
491
await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.
InvocationId
, 10)).DefaultTimeout();
518
Assert.NotNull(invocation.
InvocationId
);
522
await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithError(invocation.
InvocationId
, "Error from client")).DefaultTimeout();
603
Assert.NotEqual(invocation1.
InvocationId
, invocation2.
InvocationId
);
605
await manager1.SetConnectionResultAsync(connection.ConnectionId, CompletionMessage.WithResult(invocation2.
InvocationId
, 2)).DefaultTimeout();
606
await manager2.SetConnectionResultAsync(connection.ConnectionId, CompletionMessage.WithResult(invocation1.
InvocationId
, 5)).DefaultTimeout();
650
Assert.NotNull(invocation.
InvocationId
);
654
await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.
InvocationId
, "wrong type")).DefaultTimeout();
src\aspnetcore\src\SignalR\common\testassets\Tests.Utils\TestClient.cs (3)
129
if (message is HubInvocationMessage hubInvocationMessage && !string.Equals(hubInvocationMessage.
InvocationId
, invocationId))
162
if (message is HubInvocationMessage hubInvocationMessage && !string.Equals(hubInvocationMessage.
InvocationId
, invocationId))
237
return message is HubInvocationMessage hubMessage ? hubMessage.
InvocationId
: null;
Microsoft.AspNetCore.SignalR.StackExchangeRedis (6)
RedisHubLifetimeManager.cs (3)
565
RedisLog.ErrorForwardingResult(_logger, completionMessage.
InvocationId
!, ex);
701
var invocationInfo = _clientResultsManager.RemoveInvocation(((CompletionMessage)hubMessage!).
InvocationId
!);
705
hubMessage = CompletionMessage.WithError(((CompletionMessage)hubMessage!).
InvocationId
!, $"Client result wasn't deserializable to {invocationInfo?.Type.Name}.");
src\aspnetcore\src\SignalR\common\Shared\ClientResultsManager.cs (3)
54
if (_pendingInvocations.TryGetValue(message.
InvocationId
!, out var item))
58
throw new InvalidOperationException($"Connection ID '{connectionId}' is not valid for invocation ID '{message.
InvocationId
}'.");
64
if (_pendingInvocations.Remove(message.
InvocationId
!, out _))