SignalR icon indicating copy to clipboard operation
SignalR copied to clipboard

`abort` method received a 403 error when stop connection on client side

Open shixiliufanglzh opened this issue 3 years ago • 6 comments

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:

image

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.

shixiliufanglzh avatar Jun 25 '21 06:06 shixiliufanglzh

Can you share the network trace for the abort request (specifically headers) from 2.4.1 and 2.4.2?

BrennanConroy avatar Jul 29 '21 22:07 BrennanConroy

It looks like we stopped respecting connection.withCredentials once we started using fetch for abort. If set, we probably need to set credentials: "include".

halter73 avatar Jul 29 '21 22:07 halter73

@shixiliufanglzh Can you test adding credentials: "include" here in the 2.4.2 client and tell us if that fixes your issue?

halter73 avatar Jul 29 '21 23:07 halter73

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

ismail-s avatar Oct 06 '21 10:10 ismail-s

@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?

adegroff avatar Nov 29 '21 12:11 adegroff

2.4.3 is released with the fix for this issue, we're keeping the issue open to track adding a test.

BrennanConroy avatar Jan 21 '22 22:01 BrennanConroy