Skip to content

Commit

Permalink
Fix issue with Blazor wasm session state (#3937)
Browse files Browse the repository at this point in the history
* #3930 Update version to 8.1.2

* #3935 if SyncContextWithServer is false, properly initialize session

* #3929 Update version numbers to 8.2.0

* #3929 Update version numbers to 8.2.0
  • Loading branch information
rockfordlhotka authored May 13, 2024
1 parent 356b045 commit 154d824
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
14 changes: 9 additions & 5 deletions Source/Csla.Blazor.WebAssembly/State/SessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ namespace Csla.Blazor.WebAssembly.State
/// <param name="httpClient"></param>
/// <param name="options"></param>
public class SessionManager(
ApplicationContext applicationContext, HttpClient httpClient, BlazorWebAssemblyConfigurationOptions options) : ISessionManager
ApplicationContext applicationContext,
HttpClient httpClient,
BlazorWebAssemblyConfigurationOptions options) : ISessionManager
{
private readonly ApplicationContext ApplicationContext = applicationContext;
private readonly HttpClient client = httpClient;
Expand All @@ -36,7 +38,9 @@ public class SessionManager(
/// </summary>
public Session GetCachedSession()
{
return _session;
if (_options.SyncContextWithServer && _session == null)
throw new InvalidOperationException("SessionManager.Session == null");
return GetSession();
}

/// <summary>
Expand Down Expand Up @@ -119,8 +123,8 @@ private Session GetSession()
}

// server-side methods
Session ISessionManager.GetSession() => throw new NotImplementedException();
void ISessionManager.UpdateSession(Session newSession) => throw new NotImplementedException();
void ISessionManager.PurgeSessions(TimeSpan expiration) => throw new NotImplementedException();
Session ISessionManager.GetSession() => throw new NotSupportedException();
void ISessionManager.UpdateSession(Session newSession) => throw new NotSupportedException();
void ISessionManager.PurgeSessions(TimeSpan expiration) => throw new NotSupportedException();
}
}
4 changes: 2 additions & 2 deletions Source/Csla.Xaml.Uwp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.1.2.0")]
[assembly: AssemblyFileVersion("8.1.2.0")]
[assembly: AssemblyVersion("8.2.0.0")]
[assembly: AssemblyFileVersion("8.2.0.0")]
2 changes: 1 addition & 1 deletion Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- Common Package Settings -->
<PropertyGroup>
<Version>8.1.2.0</Version>
<Version>8.2.0.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://cslanet.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/MarimerLLC/csla</RepositoryUrl>
Expand Down
12 changes: 6 additions & 6 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

CSLA 8 is a substantial update to CSLA .NET, adding support for .NET 8 and other enhancements.

## CSLA .NET version 8.1.2 release
## CSLA .NET version 8.2.0 release

CSLA .NET version 8.1.2 includes bug fixes.

## CSLA .NET version 8.1.1 release
Bug fixes and enhancements.

### Change List

* https://github.com/MarimerLLC/csla/compare/v8.1.1...v8.1.2
* https://github.com/MarimerLLC/csla/compare/v8.1.1...v8.2.0

### Contributors

* @swegele

CSLA .NET version 8.1.1 includes bug fixes.
## CSLA .NET version 8.1.1 release

Bug fixes.

### Change List

Expand Down

0 comments on commit 154d824

Please sign in to comment.