1 write to InvocationId
Microsoft.AspNetCore.SignalR.Common (1)
Protocol\HubInvocationMessage.cs (1)
29InvocationId = invocationId;
174 references to InvocationId
Microsoft.AspNetCore.Components.Server (6)
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (6)
431if (string.IsNullOrEmpty(message.InvocationId)) 437writer.Write(message.InvocationId); 463writer.Write(message.InvocationId); 487writer.Write(message.InvocationId); 535writer.Write(message.InvocationId); 553writer.Write(message.InvocationId);
Microsoft.AspNetCore.Components.Server.Tests (10)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestHubMessageEqualityComparer.cs (10)
36return string.Equals(cancelItemMessage.InvocationId, ((CancelInvocationMessage)y).InvocationId, StringComparison.Ordinal); 54&& string.Equals(x.InvocationId, y.InvocationId, StringComparison.Ordinal) 63&& string.Equals(x.InvocationId, y.InvocationId, StringComparison.Ordinal) 70&& string.Equals(x.InvocationId, y.InvocationId, StringComparison.Ordinal) 79&& string.Equals(x.InvocationId, y.InvocationId, StringComparison.Ordinal)
Microsoft.AspNetCore.SignalR.Client.Core (19)
HubConnection.cs (17)
1297Log.ArgumentBindingFailure(_logger, bindingFailure.InvocationId, bindingFailure.Target, bindingFailure.BindingFailure.SourceException); 1299if (!string.IsNullOrEmpty(bindingFailure.InvocationId)) 1301await SendWithLock(connectionState, CompletionMessage.WithError(bindingFailure.InvocationId, "Client failed to parse argument(s)."), cancellationToken: default).ConfigureAwait(false); 1305Log.ReceivedInvocation(_logger, invocation.InvocationId, invocation.Target, invocation.Arguments); 1309if (!connectionState.TryRemoveInvocation(completion.InvocationId!, out irq)) 1311Log.DroppedCompletionMessage(_logger, completion.InvocationId!); 1321if (!connectionState.TryGetInvocation(streamItem.InvocationId!, out irq)) 1323Log.DroppedStreamMessage(_logger, streamItem.InvocationId!); 1366var expectsResult = !string.IsNullOrEmpty(invocation.InvocationId); 1375await SendWithLock(connectionState, CompletionMessage.WithError(invocation.InvocationId!, "Client didn't provide a result."), cancellationToken: default).ConfigureAwait(false); 1379Log.ErrorSendingInvocationResult(_logger, invocation.InvocationId!, invocation.Target, ex); 1425await SendWithLock(connectionState, CompletionMessage.WithError(invocation.InvocationId!, resultException.Message), cancellationToken: default).ConfigureAwait(false); 1429await SendWithLock(connectionState, CompletionMessage.WithResult(invocation.InvocationId!, result), cancellationToken: default).ConfigureAwait(false); 1434await SendWithLock(connectionState, CompletionMessage.WithError(invocation.InvocationId!, "Client didn't provide a result."), cancellationToken: default).ConfigureAwait(false); 1439Log.ErrorSendingInvocationResult(_logger, invocation.InvocationId!, invocation.Target, ex); 1616if (string.IsNullOrEmpty(invocationMessage.InvocationId)) 2303Log.DroppingMessage(_logger, ((HubInvocationMessage)message).GetType().Name, ((HubInvocationMessage)message).InvocationId);
HubConnection.Log.cs (2)
42SendingMessage(logger, message.GetType().Name, invocationMessage.InvocationId); 63MessageSent(logger, message.GetType().Name, invocationMessage.InvocationId);
Microsoft.AspNetCore.SignalR.Common (8)
Protocol\CompletionMessage.cs (2)
54return $"Completion {{ {nameof(InvocationId)}: \"{InvocationId}\", {nameof(Error)}: {errorStr}{resultField} }}";
Protocol\HubMethodInvocationMessage.cs (4)
120return $"InvocationMessage {{ {nameof(InvocationId)}: \"{InvocationId}\", {nameof(Target)}: \"{Target}\", {nameof(Arguments)}: [ {args} ], {nameof(StreamIds)}: [ {streamIds} ] }}"; 175return $"StreamInvocation {{ {nameof(InvocationId)}: \"{InvocationId}\", {nameof(Target)}: \"{Target}\", {nameof(Arguments)}: [ {args} ], {nameof(StreamIds)}: [ {streamIds} ] }}";
Protocol\StreamItemMessage.cs (2)
29return $"StreamItem {{ {nameof(InvocationId)}: \"{InvocationId}\", {nameof(Item)}: {Item ?? "<<null>>"} }}";
Microsoft.AspNetCore.SignalR.Common.Tests (16)
Internal\Protocol\JsonHubProtocolTests.cs (2)
167Assert.Equal("1", streamItemMessage.InvocationId); 200Assert.Equal("1", completionMessage.InvocationId);
Internal\Protocol\JsonHubProtocolTestsBase.cs (2)
479Assert.Equal("1", completion.InvocationId); 495Assert.Equal("1", completion.InvocationId);
Internal\Protocol\MessagePackHubProtocolTests.cs (2)
256Assert.Equal("xyz", completion.InvocationId); 270Assert.Equal("xyz", completion.InvocationId);
Internal\Protocol\TestHubMessageEqualityComparer.cs (10)
36return string.Equals(cancelItemMessage.InvocationId, ((CancelInvocationMessage)y).InvocationId, StringComparison.Ordinal); 54&& string.Equals(x.InvocationId, y.InvocationId, StringComparison.Ordinal) 63&& string.Equals(x.InvocationId, y.InvocationId, StringComparison.Ordinal) 70&& string.Equals(x.InvocationId, y.InvocationId, StringComparison.Ordinal) 79&& string.Equals(x.InvocationId, y.InvocationId, StringComparison.Ordinal)
Microsoft.AspNetCore.SignalR.Core (28)
Internal\DefaultHubDispatcher.cs (20)
163Log.DroppingMessage(_logger, hubMessage.GetType().Name, (hubMessage as HubInvocationMessage)?.InvocationId ?? "(null)"); 186if (connection.ActiveRequestCancellationSources.TryGetValue(cancelInvocationMessage.InvocationId!, out var cts)) 188Log.CancelStream(_logger, cancelInvocationMessage.InvocationId!); 213else if (_hubLifetimeManager.TryGetReturnType(completionMessage.InvocationId!, out _)) 219Log.UnexpectedCompletion(_logger, completionMessage.InvocationId!); 251return SendInvocationError(bindingFailureMessage.InvocationId, connection, errorMessage); 289if (!string.IsNullOrEmpty(hubMethodInvocationMessage.InvocationId)) 293hubMethodInvocationMessage.InvocationId, $"Unknown hub method '{hubMethodInvocationMessage.Target}'")).AsTask(); 336await SendInvocationError(hubMethodInvocationMessage.InvocationId, connection, 354await SendInvocationError(hubMethodInvocationMessage.InvocationId, connection, 380_ = StreamAsync(hubMethodInvocationMessage.InvocationId!, connection, arguments, scope, hubActivator, hub, cts, hubMethodInvocationMessage, descriptor); 413Log.SendingResult(logger, hubMethodInvocationMessage.InvocationId, methodExecutor); 420await SendInvocationError(hubMethodInvocationMessage.InvocationId, connection, 442if (!string.IsNullOrEmpty(hubMethodInvocationMessage.InvocationId)) 445await connection.WriteAsync(CompletionMessage.WithResult(hubMethodInvocationMessage.InvocationId, result)); 467await SendInvocationError(hubMethodInvocationMessage.InvocationId, connection, 473await SendInvocationError(hubMethodInvocationMessage.InvocationId, connection, 696if (!string.IsNullOrEmpty(hubMethodInvocationMessage.InvocationId)) 699await connection.WriteAsync(CompletionMessage.WithError(hubMethodInvocationMessage.InvocationId, 709await 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\SignalR\common\Shared\ClientResultsManager.cs (3)
54if (_pendingInvocations.TryGetValue(message.InvocationId!, out var item)) 58throw new InvalidOperationException($"Connection ID '{connectionId}' is not valid for invocation ID '{message.InvocationId}'."); 64if (_pendingInvocations.Remove(message.InvocationId!, out _))
StreamTracker.cs (2)
54if (TryGetConverter(message.InvocationId!, out var converter)) 76_lookup.TryRemove(message.InvocationId!, out var converter);
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
717if (!string.IsNullOrEmpty(message.InvocationId)) 719writer.WriteString(InvocationIdPropertyNameBytes, message.InvocationId);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (6)
Protocol\MessagePackHubProtocolWorker.cs (6)
431if (string.IsNullOrEmpty(message.InvocationId)) 437writer.Write(message.InvocationId); 463writer.Write(message.InvocationId); 487writer.Write(message.InvocationId); 535writer.Write(message.InvocationId); 553writer.Write(message.InvocationId);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
696if (!string.IsNullOrEmpty(message.InvocationId)) 699writer.WriteValue(message.InvocationId);
Microsoft.AspNetCore.SignalR.Specification.Tests (24)
HubLifetimeManagerTestBase.cs (11)
191Assert.NotNull(invocation.InvocationId); 194await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 218Assert.NotNull(invocation.InvocationId); 221await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client")).DefaultTimeout(); 248Assert.NotNull(invocation.InvocationId); 252manager.SetConnectionResultAsync(connection2.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client"))).DefaultTimeout(); 254Assert.Equal($"Connection ID '{connection2.ConnectionId}' is not valid for invocation ID '{invocation.InvocationId}'.", ex.Message); 257await manager.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 307await manager1.SetConnectionResultAsync(connection2.ConnectionId, CompletionMessage.WithError(invocation2.InvocationId, "error")); 312await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 3)); 365await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 1));
ScaleoutHubLifetimeManagerTests.cs (10)
487Assert.NotNull(invocation.InvocationId); 491await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, 10)).DefaultTimeout(); 518Assert.NotNull(invocation.InvocationId); 522await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithError(invocation.InvocationId, "Error from client")).DefaultTimeout(); 603Assert.NotEqual(invocation1.InvocationId, invocation2.InvocationId); 605await manager1.SetConnectionResultAsync(connection.ConnectionId, CompletionMessage.WithResult(invocation2.InvocationId, 2)).DefaultTimeout(); 606await manager2.SetConnectionResultAsync(connection.ConnectionId, CompletionMessage.WithResult(invocation1.InvocationId, 5)).DefaultTimeout(); 650Assert.NotNull(invocation.InvocationId); 654await manager1.SetConnectionResultAsync(connection1.ConnectionId, CompletionMessage.WithResult(invocation.InvocationId, "wrong type")).DefaultTimeout();
src\SignalR\common\testassets\Tests.Utils\TestClient.cs (3)
129if (message is HubInvocationMessage hubInvocationMessage && !string.Equals(hubInvocationMessage.InvocationId, invocationId)) 162if (message is HubInvocationMessage hubInvocationMessage && !string.Equals(hubInvocationMessage.InvocationId, invocationId)) 237return message is HubInvocationMessage hubMessage ? hubMessage.InvocationId : null;
Microsoft.AspNetCore.SignalR.StackExchangeRedis (6)
RedisHubLifetimeManager.cs (3)
565RedisLog.ErrorForwardingResult(_logger, completionMessage.InvocationId!, ex); 701var invocationInfo = _clientResultsManager.RemoveInvocation(((CompletionMessage)hubMessage!).InvocationId!); 705hubMessage = CompletionMessage.WithError(((CompletionMessage)hubMessage!).InvocationId!, $"Client result wasn't deserializable to {invocationInfo?.Type.Name}.");
src\SignalR\common\Shared\ClientResultsManager.cs (3)
54if (_pendingInvocations.TryGetValue(message.InvocationId!, out var item)) 58throw new InvalidOperationException($"Connection ID '{connectionId}' is not valid for invocation ID '{message.InvocationId}'."); 64if (_pendingInvocations.Remove(message.InvocationId!, out _))
Microsoft.AspNetCore.SignalR.Tests (44)
HubConnectionHandlerTests.ClientResult.cs (31)
29Assert.NotNull(invocationMessage.InvocationId); 31await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 35Assert.Equal(invocationId, completion.InvocationId); 62Assert.NotNull(invocationMessage.InvocationId); 63await client.SendHubMessageAsync(CompletionMessage.WithError(invocationMessage.InvocationId, "Client error")).DefaultTimeout(); 67Assert.Equal(invocationId, completion.InvocationId); 155await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout(); 189await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout(); 218Assert.NotNull(invocationMessage.InvocationId); 220await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 257Assert.NotNull(invocationMessage.InvocationId); 258Assert.NotNull(invocationMessage2.InvocationId); 259Assert.NotNull(invocationMessage3.InvocationId); 261await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 264Assert.Equal(invocationId, completion.InvocationId); 267await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage2.InvocationId, res)).DefaultTimeout(); 270Assert.Equal(invocationId2, completion.InvocationId); 273await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage3.InvocationId, res)).DefaultTimeout(); 276Assert.Equal(invocationId3, completion.InvocationId); 308Assert.NotNull(invocationMessage.InvocationId); 310await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 388await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout(); 433await client.SendHubMessageAsync(CompletionMessage.WithResult(invocation.InvocationId, 2)).DefaultTimeout(); 463Assert.NotNull(invocationMessage.InvocationId); 465Assert.Equal("s1", invocationMessage.InvocationId); 468await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 472Assert.Equal(invocationId, completion.InvocationId); 501Assert.NotNull(invocationMessage.InvocationId); 503await client.SendHubMessageAsync(CompletionMessage.WithResult(invocationMessage.InvocationId, res)).DefaultTimeout(); 507Assert.Equal(invocationId, streamItem.InvocationId); 510Assert.Equal(invocationId, completionMessage.InvocationId);
HubConnectionHandlerTests.cs (9)
408Assert.Equal("1", completionMessage.InvocationId); 446Assert.Equal("1", completionMessage.InvocationId); 562Assert.Equal("1", completionMessage.InvocationId); 567Assert.Equal("2", completionMessage.InvocationId); 613Assert.Equal("1", completionMessage.InvocationId); 618Assert.Equal("2", completionMessage.InvocationId); 623Assert.Equal("3", completionMessage.InvocationId); 2060Assert.Equal(invocationId, hubMessage.InvocationId); 3538Assert.Equal(streamInvocationId, completion.InvocationId);
HubConnectionHandlerTestUtils\Utils.cs (4)
46Assert.True((expectedInvocation.InvocationId == null && actualInvocation.InvocationId == null) || 47(expectedInvocation.InvocationId != null && actualInvocation.InvocationId != null));
Microsoft.AspNetCore.SignalR.Tests.Utils (3)
TestClient.cs (3)
129if (message is HubInvocationMessage hubInvocationMessage && !string.Equals(hubInvocationMessage.InvocationId, invocationId)) 162if (message is HubInvocationMessage hubInvocationMessage && !string.Equals(hubInvocationMessage.InvocationId, invocationId)) 237return message is HubInvocationMessage hubMessage ? hubMessage.InvocationId : null;