dotnet / aspire-samples

MIT License
655 stars 193 forks source link

[eShopLite] Exception when navigating to cart #36

Closed timheuer closed 10 months ago

timheuer commented 11 months ago

I'm not sure how functional the sample is supposed to be but...

  1. Run the eShopLite apphost
  2. Navigate to frontend
  3. add some things to cart
  4. Click cart OBSERVE: Cart goes from a count to 0
  5. Click cart again OBSERVE: exception
    Grpc.Core.RpcException: Status(StatusCode="NotFound", Detail="Basket with buyer id user does not exist")
    at eShopLite.Frontend.Services.BasketServiceClient.CheckoutBasketAsync(String buyerId) in D:\GitHub\aspire-samples\samples\eShopLite\eShopLite.Frontend\Services\BasketServiceClient.cs:line 60
    at eShopLite.Frontend.Components.Cart.HandleCheckout() in D:\GitHub\aspire-samples\samples\eShopLite\eShopLite.Frontend\Components\Cart.razor:line 42
    at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
    at Microsoft.AspNetCore.Components.Forms.EditForm.HandleSubmitAsync()
    at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
    at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    at Microsoft.AspNetCore.Components.RenderTree.Renderer.<WaitForQuiescence>g__ProcessAsynchronousWork|54_0()
    at Microsoft.AspNetCore.Components.RenderTree.Renderer.WaitForQuiescence()
    at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.SendStreamingUpdatesAsync(HttpContext httpContext, Task untilTaskCompleted, TextWriter writer)
baskan commented 11 months ago

because there is no "cart page", clicking cart icon check-out the cart and removes the contents of the cart that's why cart doesn't exists.

DamianEdwards commented 10 months ago

I think this started happening when we did a refactoring of the gRPC logic for the basket service (here? https://github.com/dotnet/aspire/pull/361) in the main repo version of this but I perhaps haven't ported it over fully. Let me take another look.

DamianEdwards commented 10 months ago

OK yep this is a side-effect of dotnet/aspire#361. I have a fix in PR now.