In Blazor server disconnects immediately after connecting to the web socket using state persisting.
Is there an existing issue for this?
- [x] I have searched the existing issues
Describe the bug
On pages with InteractiveServer, when I persist state after connecting to the websocket, it immediately disconnects (according to experience, this error occurs when moving from an SSR page to an InteractiveServer and does not occur when moving from an InteractiveServer to an InteractiveServer)
This problem does not occur without persisting state.
public interface IUsersExtraInfoApiDomain
{
Task<AddresApiResponce> GetLstUserAddress(string UserID);
}
public async Task<AddresApiResponce> GetLstUserAddress(string UserID)
{
await using var _MeroojDbContext = ContextFactory.CreateDbContext();
AddresApiResponce Result = new AddresApiResponce();
Result.Data = await _MeroojDbContext.Table_UserAddresses.Where(o => o.UserID == UserID).Select(o => new AddresObjectApiResponce()
{
CityID = o.CityID,
FullAddress = o.FullAddress,
LocationLat = o.LocationLat,
LocationLong = o.LocationLong,
Number = o.Number,
Unit = o.Unit,
ID= o.UserAddressID,
Active= o.Active
}).ToListAsync();
Result.StatusCode = 200;
return Result;
}
private AddresApiResponce AddressResponce = new();
protected override async Task OnInitializedAsync()
{
AddressResponce = await StateService.GetValue($"{nameof(AddressComponent)}-addressResponce", async () => await GetListUserAddress()) ?? new();
}
private async Task<AddresApiResponce> GetListUserAddress()
{
return await UsersExtraInfoApi.GetLstUserAddress(UserId!);
}
// The injectables are in AppComponentBase .
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
9.0.202
Anything else?
No response
Apologies for the delayed response. We won't prioritize Blazor SSR + Interactive until the Blazor team resolves this issue. In the meantime, I suggest using Blazor WebAssembly with pre-rendering for fast websites and apps, like https://bitplatform.dev itself!
I'm closing this issue since there hasn't been any activity here for a long time. Feel free to open it if needed.