Fix issue with Blazor state#4786
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses issue #4774 by fixing Blazor state management behavior. The changes ensure that session state is properly tracked and persisted across both server-side and WebAssembly Blazor applications.
Key changes include:
- Adding
Touch()calls to mark sessions as updated when state changes occur in server-side Blazor - Refactoring constant names for context keys to improve maintainability
- Converting
SaveState()from async to synchronous by returning the Task directly - Upgrading sample applications to .NET 10 and updating package versions
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/version.json | Version bump to 10.0.0-beta.0021 |
| Source/Csla.Blazor/State/StateManager.cs | Refactored SaveState() method to return Task directly and added Touch() calls for server-side state persistence |
| Source/Csla.AspNetCore/Blazor/ApplicationContextManagerBlazor.cs | Added session.Touch() calls when setting local and client context to ensure state changes are tracked |
| Source/Csla.Blazor.WebAssembly/ApplicationContextManager.cs | Extracted magic strings to constants for context names |
| Samples/BlazorExample/Directory.Packages.props | Updated package versions to 10.0.0 and CSLA version |
| Samples/BlazorExample (multiple .csproj files) | Updated target framework from net9.0 to net10.0 |
| Samples/BlazorExample/.../Program.cs | Added server-side data portal configuration |
| Samples/BlazorExample/.../CslaStateController.cs | Added using directive for Messages namespace |
| Samples/BlazorExample/.../Counter.razor | Refactored to use RendererInfo, removed manual IsInteractive tracking, and added SaveState() call |
| Samples/BlazorExample/.../NavMenu.razor | Whitespace formatting change |
| Samples/BlazorExample/.../App.razor | Updated static asset references to use Assets helper |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nents/Pages/Counter.razor Co-authored-by: Copilot <[email protected]>
…ayout/NavMenu.razor Co-authored-by: Copilot <[email protected]>
rockfordlhotka
added a commit
that referenced
this pull request
Jan 8, 2026
rockfordlhotka
added a commit
that referenced
this pull request
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4774