SignalR
SignalR copied to clipboard
`abort` method received a 403 error when stop connection on client side
After updating the version of this package from 2.4.1 to 2.4.2, once I call connection.stop()
on client side, an error will be print on console panel as below screenshot:
I just create the connection after app initialized
this.connection = this._signalR.createConnection({url: this.electron.appConfig.baseUrl});
this.connection.start();
and then call stop method manually
this.connection.invoke('Logout');
setTimeout(() => {
this.connection.stop();
this.router.navigateByUrl('/login');
}, 3000);
Then the connection will not be disconnected as expected.
but when I rollback the version to 2.4.1, everything worked normally.
Can you share the network trace for the abort request (specifically headers) from 2.4.1 and 2.4.2?
It looks like we stopped respecting connection.withCredentials
once we started using fetch for abort. If set, we probably need to set credentials: "include"
.
@shixiliufanglzh Can you test adding credentials: "include"
here in the 2.4.2 client and tell us if that fixes your issue?
Hi @halter73.
We also have run into this issue (in our case, with a different error response, but still the same issue), and have found that your proposed fix https://github.com/SignalR/SignalR/issues/4567#issuecomment-889527992 does fix this issue for us. Do you have any idea how long it could take for this fix to get included in the next release?
Thanks, Ismail
@halter73 @BrennanConroy Is there a pull request out there with this change for 2.4.3? When will we expect version 2.4.3 to be released?
2.4.3 is released with the fix for this issue, we're keeping the issue open to track adding a test.