-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Describe the bug
We have an application that is nearing completion and is the final user acceptance phase. We've noticed that on some of our testers systems SignalR has connection errors. On both machines, reseting Chrome to default corrected the issue, but we're concerned that when the application moves to production this will be a support issue. On one of the systems we were able to consistently track the issue to this extension https://chrome.google.com/webstore/detail/auto-refresh/ifooldnmmcmlbdennkpdnlnbgbmfalko. The other system that was having the issue never had that extension installed.
To Reproduce
Steps to reproduce the behavior:
- Using this version of ASP.NET Core '2.2.6'
- Run this code
2a. on server
app.UseSignalR(routes => routes.MapHub<ExamHub>(srConfig.ExamHubUrl, o =>
{
o.ApplicationMaxBufferSize = 0;
o.TransportMaxBufferSize = 0;
}));
2b. on client
private _initiateHubConnection = (): void => {
this._debugService.logDebug(this, ["Exam Hub Connection Initializing"], null, true, "_initiateHubConnection");
// create connection to signalR
let builder = new HubConnectionBuilder();
//if(navigator.userAgent.indexOf("Chrome") !== -1 )
// this.hubConnection = builder
// .withUrl(this._bwf.examUpdateUrl, {
// transport: signalR.HttpTransportType.ServerSentEvents,
// })
// .configureLogging(this._signalrLogger)
// // .withHubProtocol(new JsonHubProtocol())
// //.withHubProtocol(new MessagePackHubProtocol())
// .build();
//else
this.hubConnection = builder
.withUrl(this._bwf.examUpdateUrl)
// .configureLogging(this._signalrLogger)
// .withHubProtocol(new JsonHubProtocol())
//.withHubProtocol(new MessagePackHubProtocol())
.build();
// handle communication from signalR
this.hubConnection.on("AddExams", async(notification: INotificationViewModel) => await this._onNotificationAddExams(notification));
this.hubConnection.on("UpdateExams", async(notification: INotificationViewModel) => await this._onNotificationUpdateExams(notification));
this.hubConnection.onclose((err) => {
this.state = DataServiceState.disconnected;
if (err) {
this._debugService.logWarning(this, [err, 'Connection Restarting'], 'Error in Exams Connection',true,"_initiateHubConnection");
toastr.warning(`Error in Exam Update Connection: ${err}`, "Error in Exam Update Connection",true,"_initiateHubConnection");
}
this.state = DataServiceState.connecting;
this.hubConnection.start().then(() => this._onHubConnectionStart());
});
// start the connection
this.hubConnection.start().then(() => this._onHubConnectionStart());
this._debugService.logSuccess(this, ["Exam Hub Connection Initialized"], null, true, "_initiateHubConnection");
};
- Errors in client
Expected behavior
Would like the the signalr connections to stay up reliably
Additional context
I know this is light on information. I'm really just looking for general guidelines to prevent extensions from causing issues.