-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring Stateful Reconnect #31452
Comments
@CePur, thanks for taking the time to let us know your experience with this doc. |
@wadepickett i don't directly reference it so there is no Microsoft.AspNetCore.SignalR.Client in .csproj. Project is asp.net web project |
Thanks for the insight! |
With the following set in Program.CS for stateful reconnect: and
The example we had in there for a JavaScript Client was the following:
But that example currently in the doc does indeed result in a runtime error that does not recognize Looking in the latest js unpkg package as it downloads (@microsoft/[email protected]) the option .withStatefulReconnect() does not exist so the error makes sense. It is not in there, but that is the latest version you get. Maybe the 8.0 updates did not actually get into that unpkg package? However, I do see .withStatefulReconnect() defined here: https://unpkg.com/@microsoft/[email protected]/src/HubConnectionBuilder.ts Am I somehow getting the wrong js package, or the call to HubConnectionBuilder, or for a JavaScript client should I be doing something different such as:
I'll update this doc and the What's new for .NET 8 that had the same example with whatever the correction should be. I'm not sure what the correct client setting should be though. |
@BrennanConroy, I'm hoping you might be able to take a look a this above. I would have to get the fix in today to get a review in time for this sprint. Sorry to ask, I looked through the source and all related issues and the end result SignalR.js. I'm not able to get it to work as intended. |
The function does exist, look at line 3474 of https://unpkg.com/browse/@microsoft/[email protected]/dist/browser/signalr.js I'm guessing they aren't using an 8.0 version of the library. |
Thanks @BrennanConroy. Could you check a new download through the VS libman using unpkg for browser/signalr.js for 8.0.0 or "latest"? I see it on the unpkg site as you pointed out. However, when I add it through Visual Studio using the Library Manager for unpkg and I either specify "latest" or "8.0.0" I receive a version that does not have the word "stateful" anywhere in browser/signalr.js Here is what lines 1177 - 1181 should have in it: The downloaded 8.0.0 signalr.js however is missing the const for DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE: withServerTimeout(), withKeepAliveInterval() and withStatefulReconnect()should be defined right after withAutomaticReconnect() starting on line 3456 through 3481. Should I file a tracking issue? Maybe it is cache issue on unpkg for 8.0.0 or it was not propagated across all their servers? I checked I also checked jsdelivr, that service for 8.0.0 is fine, withStatefulReconnect and the other new functions are in there as expected. |
Just tried, it has the stateful reconnect code. |
Interesting. I must be doing something goofy on this end. I get 8.0.0 for jsdelivr just fine, for unpkg 8.0.0 shows up selectable and downloads, but the actual download that arrives is a version before 8.0.0 without stateful reconnect. I started with new projects each test and reboot VS. I have the latest VS. This issue is just for unpkg for me when using libman on VS. Maybe I am getting a particular server on the farm for unpkg and re-hitting it? That seems slim though, so must be something I am missing on my end given you are not able to recreate. Thanks. |
Closing since not a doc issue to update here after testing it out. |
I believe i found the issue. For future wanderers: |
Awesome, thanks @CePur! |
Description
[Enter feedback here]
Hi, trying stateful reconnect but js throws this exception
"(intermediate value).withUrl(...).withStatefulReconnect is not a function". Using https://unpkg.com/browse/@microsoft/[email protected]/
Page URL
https://learn.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-8.0&tabs=dotnet#configure-stateful-reconnect
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/signalr/configuration.md
Document ID
66d252c3-6300-7e28-9aa0-ef2ff66e7a76
Article author
@bradygaster
Associated WorkItem - 226929
The text was updated successfully, but these errors were encountered: