-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Async FetchChildAsync locks up Blazor wasm app #1566
Labels
Comments
Yeah... 😳😳😳 I had an infinite loop bug in my test code - each time it fetched a child, it fetched that child's child! So the data portal and everything works as expected - the "bug" was sitting at the keyboard. Working code: using Csla;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace BlazorApp1.Client
{
[Serializable]
public class ValueEdit : BusinessBase<ValueEdit>
{
public static readonly PropertyInfo<string> ValueProperty = RegisterProperty<string>(nameof(Value));
public string Value
{
get => GetProperty(ValueProperty);
set => SetProperty(ValueProperty, value);
}
public static readonly PropertyInfo<ValueEdit> ChildProperty = RegisterProperty<ValueEdit>(nameof(Child));
public ValueEdit Child
{
get => GetProperty(ChildProperty);
set => SetProperty(ChildProperty, value);
}
[Fetch]
[FetchChild]
private async Task FetchAsync(string name, [Inject] HttpClient httpClient)
{
Console.WriteLine($"entering {nameof(FetchAsync)}-{name}");
var response = await httpClient.GetAsync("/api/value");
var value = await response.Content.ReadAsStringAsync();
Console.WriteLine($"after readstring {nameof(FetchAsync)}-{name}");
using (BypassPropertyChecks)
{
Value = value;
if (name != "child")
Child = await DataPortal.FetchChildAsync<ValueEdit>("child");
}
Console.WriteLine($"exiting {nameof(FetchAsync)}-{name}");
}
}
} |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As per MarimerLLC/cslaforum#922
Calling
DataPortal.FetchAsync<ValueEdit>()
on this class locks the app.The text was updated successfully, but these errors were encountered: