Giter Club home page Giter Club logo

Comments (4)

WhitWaldo avatar WhitWaldo commented on August 29, 2024 2

I think the issue lies with the use of OnAfterRenderAsync in the StoreInitializer. If I set a breakpoint on the OnInitialized method, it breaks and I can step through it without an issue. But HasActivatedStore is only set to true when Store.InitializeAsync() is called and this only happens during OnAfterRenderAsync which doesn't ever break for me, so all the actions accumulate and are never processed, yielding the effect I've been observing.

I took at look at the after component render documentation to get a sense of what changed here between .NET 7 and .NET 8 as I couldn't remember anything off the top of my head about it.

Interestingly, the .NET 8 docs differ from the .NET 7 docs is the added note that "these methods aren't invoked during rendering on the server". As I understand it, the Auto rendering starts on the server, finishes the various lifecycles necessary, then starts to download the WASM client at which point it switches contexts, but that suggests that this lifecycle method is never called in that case as it's always running on the server initially.

While this appears to continue to be the best place to put the JS invocations, I would urge you to consider moving the await Store.InitializeAsync() out of this method. As OnParametersSet is now called before OnInitialized (in .NET 7 it was flipped), I might suggest moving this line into the end of the OnInitializedAsync method instead as that's always called on either the server or client rendering modes, is called after the existing OnInitialized method implementation and happens after OnParametersSet now, making it the latest lifecycle method before OnAfterRender method invocation (which again, doesn't happen on server anymore).

from fluxor.

WhitWaldo avatar WhitWaldo commented on August 29, 2024

Interestingly, I attached the Fluxor symbols to the debugger to step through and understand what's happening. In Store.cs, the QueuedActions queue is receiving all these actions as expected, but it never elects to dequeue any of them, meaning nothing is processed.

HasActivatedStore is false, so perhaps something has changed about how Blazor is indicating when a page has finished loading that's causing the issue - per the comments a few lines down, it's only when the page finishes loading that DequeueActions is called.

image

from fluxor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.