-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Implement .NET 8 Blazor state management #3641
Conversation
Hi. Would you mind comments and questions from me to this pr changes? |
I love feedback! @ossendorf-at-hoelscher if you'd like to be able to use the PR feedback tools in GitHub, please send me a signed contributor agreement and I'll add you. |
I'll discuss this with my superior if I can get some worktime for such things. Otherwise I'll send one from my private account 😄 |
@ossendorf-at-hoelscher I made quite a few changes - some based on your feedback. I had it working, and then did something that broke the transition from wasm back to server. And I don't know what I did to break it 😢 Some observations.
I don't know how deeply you (or anyone else) wants to invest in helping to get this working, but just in case, I have pushed my test project to GitHub: https://github.com/rockfordlhotka/CslaBlazorApp The solution directly references the
If you clone those two repos into that folder structure, the solution should just load and run. Unfortunately, right now, navigating from the Counter page (once it reloads as wasm) back to either server-rendered page will result in a timeout because the Counter page's I can't figure out why right now. My Blazor8State app is implemented basically the same exact way, and it works fine (as did the CslaBlazorApp at one point in here). |
@rockfordlhotka A short analysis shows that your |
I suppose I should have read your comment more carefully 😅. The Counters On that regard: You should change the Blazor StateManager from |
The goal is to support LocalContext, and the developer can change those values as they choose. So any changes made in wasm should be available on the server (and visa versa). With my Blazor8State app I was able to make this work using the ischeckedout flag and the Dispose in the wasm page. I momentarily had it working in CSLA as well, and really wish I'd done a git commit at that point! |
Sadly it really is. The wasm page isn't disposed because the server page is blocking the transition. If the server page doesn't block, then dispose is called, the state is updated on the server, and the while loop exits. |
Do we have different before?
Just to make sure: when I start your app with F5 and navigate away from
counter. I get always the timeout exception. The WASM page gets disposed
after the exception happens. So the spinlock is executing and not
blocked/dead.
Btw: happy new year 😄
Rockford Lhotka ***@***.***> schrieb am Mo., 1. Jan. 2024,
22:46:
… Furthermore it's not a deadlock
Sadly it really is. The wasm page isn't disposed because the server page
is blocking the transition.
If the server page doesn't block, then dispose is called, the state is
updated on the server, and the while loop exits.
—
Reply to this email directly, view it on GitHub
<#3641 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJCZOPXXLHUIMROKOZW64TYMMVERAVCNFSM6AAAAABBE2FUTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGQ4TEOJVGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Now you see why I added the timeout, otherwise the browser is permanently locked. Run the Blazor8State app to see how it works, and why I'm puzzled that the csla app fails. |
I figured it out! Finally! I was meticulously comparing my working Blazor8State code to the not working CslaBlazorApp code. Line by line, undoing all sorts of nice improvements, etc. Finally realized that the server-static page in the working code is streaming. That's the key, is to have the server-static page be streaming, so it starts rendering and thus releases the wasm page to dispose. |
Great. So back to implementing the nice improvments :D |
Since the |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Closes #3596