Skip to content
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

Use of TypeNameHandling.All causes JsonReaderException #1007

Open
chrissmiller opened this issue Nov 9, 2023 · 0 comments
Open

Use of TypeNameHandling.All causes JsonReaderException #1007

chrissmiller opened this issue Nov 9, 2023 · 0 comments

Comments

@chrissmiller
Copy link

Description

When using TypeNameHandling.All on our serialization settings for dtfx, we receive the following exception:

Handler: Exception: Orchestration execution failed due to unhandled exception. : Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: U. Path '', line 0, position 0.

[TaskFailedException]: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path '', line 1, position 1.
[TaskFailedExceptionDeserializationException]: Failed to deserialize exception from TaskActivity: Unhandled exception while executing task: Newtonsoft.Json.JsonReaderException: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path '', line 1, position 1.
   at Newtonsoft.Json.Linq.JArray.Load(JsonReader reader, JsonLoadSettings settings)
   at DurableTask.Core.Common.Utils.ConvertToJArray(String input) in /_/src/DurableTask.Core/Common/Utils.cs:line 210
   at DurableTask.Core.AsyncTaskActivity`2.RunAsync(TaskContext context, String input) in /_/src/DurableTask.Core/TaskActivity.cs:line 107
   at DurableTask.Core.TaskActivityDispatcher.<>c__DisplayClass14_1.<<OnProcessWorkItemAsync>b__2>d.MoveNext() in /_/src/DurableTask.Core/TaskActivityDispatcher.cs:line 189

It looks like this was previously resolved for the Azure Functions durable extensions package Azure/azure-functions-durable-extension#1392 which looks very similar to the TaskActivity code that's throwing here:

var jArray = Utils.ConvertToJArray(input);
.

Expected behavior

TypeNameHandling.All works and serializes properly.

Actual behavior

The framework throws the exception above.

App Details

  • Durable task package version (e.g. v1.8.3): 2.13.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant