Add MemoryPack Serializer#9838
Conversation
@dotnet-policy-service agree |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
src/Orleans.Serialization.MemoryPack/MemoryPackCodec.cs:129
- MemoryPackCodec deserialization also ignores configured MemoryPackSerializerOptions because it calls MemoryPackSerializer.Deserialize(type, sequence) without options. Use the overload which accepts _options.SerializerOptions to ensure symmetry with serialization and DeepCopy, and to honor options set via AddMemoryPackSerializer.
var bufferWriter = new BufferWriterBox<PooledBuffer>(new());
try
{
reader.ReadBytes(ref bufferWriter, (int)length);
result = MemoryPackSerializer.Deserialize(type, bufferWriter.Value.AsReadOnlySequence());
}
| var bufferWriter = new BufferWriterBox<PooledBuffer>(new()); | ||
| try | ||
| { | ||
| MemoryPackSerializer.Serialize(value.GetType(), bufferWriter, value); | ||
|
|
||
| ReferenceCodec.MarkValueField(writer.Session); | ||
| writer.WriteFieldHeaderExpected(1, WireType.LengthPrefixed); | ||
| writer.WriteVarUInt32((uint)bufferWriter.Value.Length); | ||
| bufferWriter.Value.CopyTo(ref writer); |
There was a problem hiding this comment.
MemoryPack serializer options configured via AddMemoryPackSerializer()/MemoryPackCodecOptions are currently ignored during field serialization because the Serialize call uses the default options overload. Pass _options.SerializerOptions to MemoryPackSerializer.Serialize so that user configuration is honored (consistent with DeepCopy and MessagePackCodec).
This issue also appears on line 124 of the same file.
5563b02 to
59a4f46
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* support memorypack serialization * add memory pack serializer tests * Address MemoryPack serializer review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: 大神 <xuchen@babuyo.com> Co-authored-by: Reuben Bond <reuben.bond@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add memorypack for orleans serializer
Microsoft Reviewers: Open in CodeFlow