Skip to content

Account for Layout ordering in Blazor #15001

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

Merged
merged 1 commit into from
Oct 15, 2019
Merged

Conversation

pranavkm
Copy link
Contributor

The server requires that clients send descriptors in sequence. Since MVC executes
Layouts in an inside-out manner, modify the client to explicitly order descriptors

Fixes #14474

The server requires that clients send descriptors in sequence. Since MVC executes
Layouts in an inside-out manner, modify the client to explicitly order descriptors

Fixes #14474
@pranavkm
Copy link
Contributor Author

No idea if this messes up a scenario, but all of the tests pass locally.

@pranavkm
Copy link
Contributor Author

Layouts in MVC are rendered inside out, consequently any components in a Layout page that appear before RenderBody will have an out of order sequence number:

// _Layout.cshtml
<component type="Counter" />: sequence: 1

@RenderBody()
    // Index.cshtml
    <component type="Counter" />: sequence: 0

// _Layout.cshtml
<component type="Counter" />: sequence: 2

This trips the deserialization when it sees out-of-order sequence numbers.

@pranavkm pranavkm added this to the 3.1.0-preview2 milestone Oct 14, 2019
Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like a great fix, it is how it was supposed to work, we just thought they were in order already.

I’m glad it wasn’t an issue with the viewcontext not being properly copied.

@pranavkm pranavkm merged commit 30b31d7 into release/3.1 Oct 15, 2019
@pranavkm pranavkm deleted the prkrishn/layout-components branch October 15, 2019 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants