dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.59k stars 10.06k forks source link

[Blazor] Clearer way to troubleshoot complex state transitions #51844

Open javiercn opened 1 year ago

javiercn commented 1 year ago

This came up as part of a discussion.

In complex apps is hard to detect state transitions that might happen during a brief period of time and cause issues. We could consider adding additional logging https://github.com/dotnet/aspnetcore/blob/main/src/Components/Components/src/Rendering/ComponentState.cs#L230-L244 to avoid such issues in the future.

We discuss this in the initial days of Blazor and we were concerned about the perf, but I think that the perf characteristics have changed enough that: 1) We can afford an extra "if". 2) We can find a way link it out if we need it on production builds.

/cc: @JamesNK

ghost commented 11 months ago

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

MattyLeslie commented 7 months ago

@javiercn

Below is a list of possible information to log, would you mind letting me know if sufficient and if there's anything else you'd like to see.

1) Logging the start of parameter setting (Component name included) 2) Logging any errors thrown when trying to set parameters (Component name included) 3) Logging if task.isFaulted (Component name included) 4) Logging if task.IsCancelled (Component name included) 5) Logging if parameters were set successfully (Component name included)

MattyLeslie commented 7 months ago

@javiercn

Below is a list of possible information to log, would you mind letting me know if sufficient and if there's anything else you'd like to see.

  1. Logging the start of parameter setting (Component name included)
  2. Logging any errors thrown when trying to set parameters (Component name included)
  3. Logging if task.isFaulted (Component name included)
  4. Logging if task.IsCancelled (Component name included)
  5. Logging if parameters were set successfully (Component name included)

Hey @javiercn, if you wouldn't mind letting me know if I'm on the right track, many thanks.