Azure / Azure/durabletask

Use of TypeNameHandling.All causes JsonReaderException

Aperta
#1,007 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
1.7k
Fork
335
Merge medio
2g 23h
PR unite (30g)
6

Descrizione

### 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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia da src/DurableTask.Core/TaskActivity.cs, riga 107, dove viene elaborato l’input dell’attività, e confrontalo con la correzione di durable-functions collegata nell’issue. Esamina Common/Utils.cs, riga 210, e verifica che TypeNameHandling.All non causi più la JsonReaderException segnalata né l’errore nell’analisi di JArray. Aggiungi una copertura di regressione per le impostazioni di serializzazione se la struttura di test esistente lo consente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
distributed-systems
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.