Use of TypeNameHandling.All causes JsonReaderException
- Ngôn ngữ chính
- C#
- Star
- 1.7k
- Fork
- 335
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 6
Mô tả
### 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.<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 https://github.com/Azure/azure-functions-durable-extension/pull/1392 which looks very similar to the TaskActivity code that's throwing here: https://github.com/Azure/durabletask/blob/6f902190fcf7f14d42b07e940f516e47525dbc18/src/DurableTask.Core/TaskActivity.cs#L107.
### 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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu tại src/DurableTask.Core/TaskActivity.cs dòng 107, nơi đầu vào của activity được xử lý, và so sánh với bản sửa lỗi durable-functions được liên kết trong issue. Xem xét Common/Utils.cs dòng 210 và xác minh rằng TypeNameHandling.All không còn gây ra JsonReaderException được báo cáo hoặc lỗi phân tích cú pháp JArray. Thêm kiểm thử hồi quy cho các thiết lập serialization nếu cấu trúc kiểm thử hiện có hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp
- Lĩnh vực
- distributed-systems
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100