diff --git a/src/Client/Grpc/GrpcDurableTaskClient.cs b/src/Client/Grpc/GrpcDurableTaskClient.cs index 20cc348b..d2007372 100644 --- a/src/Client/Grpc/GrpcDurableTaskClient.cs +++ b/src/Client/Grpc/GrpcDurableTaskClient.cs @@ -523,10 +523,12 @@ public override async Task> GetOrchestrationHistoryAsync( using AsyncServerStreamingCall streamResponse = this.sidecarClient.StreamInstanceHistory(streamRequest, cancellationToken: cancellation); + Microsoft.DurableTask.ProtoUtils.EntityConversionState entityConversionState = new(insertMissingEntityUnlocks: false); + List pastEvents = []; while (await streamResponse.ResponseStream.MoveNext(cancellation)) { - pastEvents.AddRange(streamResponse.ResponseStream.Current.Events.Select(DurableTask.ProtoUtils.ConvertHistoryEvent)); + pastEvents.AddRange(streamResponse.ResponseStream.Current.Events.Select(entityConversionState.ConvertFromProto)); } return pastEvents; diff --git a/src/Worker/Grpc/GrpcOrchestrationRunner.cs b/src/Worker/Grpc/GrpcOrchestrationRunner.cs index 5fbe2228..c3e91bd1 100644 --- a/src/Worker/Grpc/GrpcOrchestrationRunner.cs +++ b/src/Worker/Grpc/GrpcOrchestrationRunner.cs @@ -124,8 +124,12 @@ public static string LoadAndRun( P.OrchestratorRequest request = P.OrchestratorRequest.Parser.Base64Decode( encodedOrchestratorRequest); - List pastEvents = request.PastEvents.Select(ProtoUtils.ConvertHistoryEvent).ToList(); - IEnumerable newEvents = request.NewEvents.Select(ProtoUtils.ConvertHistoryEvent); + ProtoUtils.EntityConversionState entityConversionState = new(insertMissingEntityUnlocks: false); + + Func converter = entityConversionState.ConvertFromProto; + + List pastEvents = request.PastEvents.Select(converter).ToList(); + IEnumerable newEvents = request.NewEvents.Select(converter); Dictionary properties = request.Properties.ToDictionary( pair => pair.Key, pair => ProtoUtils.ConvertValueToObject(pair.Value));