LostBeard / SpawnDev.BlazorJS.WebWorkers

Easily call Services in separate threads with WebWorkers and SharedWebWorkers. Run Blazor WASM in the ServiceWorker.
https://blazorjs.spawndev.com
MIT License
12 stars 0 forks source link

Cannot invoke tasks on TaskPool, that take objects as arguments (even if serializable), without clear error. #2

Open TheArcaneBrony opened 5 hours ago

TheArcaneBrony commented 5 hours ago

System.Exception: Exception has been thrown by the target of an invocation. The object passed in this case was a plain DTO.

LostBeard commented 5 hours ago

Can you please provide code to reproduce the error?

TheArcaneBrony commented 4 hours ago

Hm, not sure how easy it would be to reproduce as my codebase requires an external account. Will try, however.

TheArcaneBrony commented 4 hours ago

While attempting to reproduce, got this stack overflow exception while serialising this class: https://cgit.rory.gay/matrix/LibMatrix.git/tree/LibMatrix/StateEvent.cs#n158

image

LostBeard commented 3 hours ago

Thank you. I copied the StateEvent class and I was able to reproduce the error.

It is getting caught up on this property because JsonObject has a JsonNode property and a JsonNode has a JsonObject property. This caused a stack overflow while enumerating properties for conversion info.

[JsonPropertyName("content")]
public JsonObject? RawContent
{
    get => _rawContent;
    set => _rawContent = value;
}

Fix will be up shortly.

LostBeard commented 3 hours ago

Version 2.5.18 is up with a fix for this issue.