ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.25k stars 744 forks source link

Disposed Error StrawberryShake.ObserverSession #6171

Open jonhilt opened 1 year ago

jonhilt commented 1 year ago

Is there an existing issue for this?

Product

Strawberry Shake

Describe the bug

It's entirely possible I've got something set up wrong here, but in a Blazor WASM project I'm seeing this error crop up quite a lot:

image

Just wondering if there's anything specifically I should be looking out for in trying to narrow this one down?

Thanks!

Steps to reproduce

  1. Add a GraphQL query to a Blazor WASM application
  2. Build the project (so it generates the relevant Blazor Components)
  3. Use the Blazor component

Here's an example, which uses the IGetTaskListResult identified in the log:

<UseGetTaskList Filter="@($"id eq '{Id}'")">

    <ChildContent>
        @{
            var taskList = context.QueryTaskListContents.FirstOrDefault();
            var tasks = MapTasks(@taskList.FlatData.Tasks);
        }

        @if (taskList != null)
        {
            <TaskList Id="@taskList.Id" Course="practicalblazorcomponents" Title="@taskList.FlatData.Title" Tasks="tasks"/>
        }
    </ChildContent>

</UseGetTaskList>

Relevant log output

No response

Additional Context?

No response

Version

13.0.5

jonhilt commented 1 year ago

I should add, I'm seeing these errors because I have sentry (for logging) configured like this in the Blazor WASM app's program.cs:

try
{
    await app.RunAsync();
}
catch (Exception e)
{
    SentrySdk.CaptureException(e);
    await SentrySdk.FlushAsync();
    throw;
}
michaelstaib commented 1 year ago

Can you try 13.1 rc.3

jonhilt commented 1 year ago

I see a 13.1.rc2, but not 13.1.rc3?

I'll try RC2 and see how it works out 👍

Thanks, Jon

jonhilt commented 1 year ago

Quick update, I just tried upgrading to that version and get this error on build.

.nuget\packages\strawberryshake.blazor\13.1.0-rc.2\build\StrawberryShake.Blazor.targets(38,20): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals('', 6)" cannot be evaluated. Version string was not in a correct format.

michaelstaib commented 1 year ago

What version of SDK have you installed?

Run: dotnet --version

jonhilt commented 1 year ago

7.0.202

I'm avoiding the latest as it blew up with a lot of errors for my Blazor projects (as noted here https://github.com/dotnet/razor/issues/8718)