Skip to content

Stop enforcing JSON read till end if EndInvokeJS returns early #39060

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 6 commits into from
Dec 16, 2021

Conversation

TanayParikh
Copy link
Contributor

@TanayParikh TanayParikh commented Dec 15, 2021

We don't want to enforce we've read till the end of the JSON if we've just abandoned the EndInvokeJS call entirely due to the task timing out or if it stopped waiting. If we abandoned the EndInvokeJS call, we know we haven't read till the end of the JSON (and that's expected), hence we shouldn't be throwing an exception in that case.

Fixes: #38962

@TanayParikh TanayParikh added the area-blazor Includes: Blazor, Razor Components label Dec 15, 2021
@TanayParikh TanayParikh marked this pull request as ready for review December 15, 2021 20:17
@TanayParikh TanayParikh requested a review from Pilchie as a code owner December 15, 2021 20:17
@TanayParikh TanayParikh requested review from pranavkm and a team and removed request for Pilchie December 15, 2021 20:18
@TanayParikh TanayParikh self-assigned this Dec 15, 2021
@TanayParikh TanayParikh added this to the 7.0-preview1 milestone Dec 15, 2021
}

[Fact]
public void EndInvokeJS_ThrowsIfJsonIsEmptyString()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remaining tests have been moved up from later in the file (so all the EndInvokeJS tests remain in one section). The Arrange section was also added for the tests.

@TanayParikh TanayParikh requested a review from pranavkm December 15, 2021 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
2 participants