Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ public async Task<string> PerformDiagnostics([FromQuery] string? signalRConnecti
//#if (signalR == true)
if (string.IsNullOrEmpty(signalRConnectionId) is false)
{
await appHubContext.Clients.Client(signalRConnectionId).SendAsync(SignalREvents.SHOW_MESSAGE, $"Open terms page. {DateTimeOffset.Now:HH:mm:ss}", new { pageUrl = Urls.TermsPage, action = "testAction" }, cancellationToken);
var success = await appHubContext.Clients.Client(signalRConnectionId).InvokeAsync<bool>(SignalREvents.SHOW_MESSAGE, $"Open terms page. {DateTimeOffset.Now:HH:mm:ss}", new { pageUrl = Urls.TermsPage, action = "testAction" }, cancellationToken);
Copy link

Copilot AI Jul 5, 2025

Choose a reason for hiding this comment

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

The call to InvokeAsync<bool> can throw if the client method isn't implemented or the connection is lost. Consider wrapping it in a try-catch to handle exceptions and trigger the fallback scenario.

Copilot uses AI. Check for mistakes.
if (success is false) // Client would return false if it's unable to show the message with custom action.
Copy link

Copilot AI Jul 5, 2025

Choose a reason for hiding this comment

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

[nitpick] Using success is false works, but the more conventional idiom is if (!success). Switching to !success can make the code more immediately familiar to readers.

Suggested change
if (success is false) // Client would return false if it's unable to show the message with custom action.
if (!success) // Client would return false if it's unable to show the message with custom action.

Copilot uses AI. Check for mistakes.
{
await appHubContext.Clients.Client(signalRConnectionId).SendAsync(SignalREvents.SHOW_MESSAGE, $"Simple message. {DateTimeOffset.Now:HH:mm:ss}", null, cancellationToken);
}
}
//#endif

Expand Down
Loading