1 write to InvocationId
Microsoft.AspNetCore.SignalR.Common (1)
174 references to InvocationId
Microsoft.AspNetCore.Components.Server (6)
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);
Microsoft.AspNetCore.SignalR.Common (8)
Microsoft.AspNetCore.SignalR.Common.Tests (16)
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!,
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (6)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
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();
Microsoft.AspNetCore.SignalR.StackExchangeRedis (6)
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);
Microsoft.AspNetCore.SignalR.Tests.Utils (3)