Repository navigation
Serialization.V2: remove [AkkaEnvelopePayload]; a property typed object is the serializer boundary - #8518
Merged
Aaronontheweb merged 2 commits intoSep 8, 2026
Conversation
…ct is the serializer boundary Part of akkadotnet#8384 (Decision 20 in the OpenSpec design record). - A property whose static type, after generic substitution, is object (or object?) is the envelope-payload boundary; no attribute is needed - AkkaEnvelopePayloadAttribute and AKKASG035 are removed - New AKKASG038: a field-level [AkkaUnion] on an object-typed property is an error - AKKASG003 hint now reads: declare a closed member set with [AkkaUnion], or type the property as object - Artery's system-message envelope, the benchmark envelope, and test fixtures are retyped to object; emitted code and wire format are unchanged
…he object-typed serializer boundary
Aaronontheweb
enabled auto-merge (squash)
September 8, 2026 21:06
Aaronontheweb
added a commit
that referenced
this pull request
Sep 8, 2026
…boundary (#8518) (#8520) Part of #8384. Updates docs/articles/serialization/source-generated-serialization.md so it matches dev after #8518: a property typed object is the serializer boundary, [AkkaEnvelopePayload] is gone, AKKASG035 is retired, AKKASG038 is documented, and an object element inside a collection is listed as a current limitation.
This was referenced Sep 9, 2026
Aaronontheweb
added a commit
to Aaronontheweb/akka.net
that referenced
this pull request
Sep 11, 2026
akkadotnet#8518; object-typed payloads are the boundary akkadotnet#8518 (6775212) removed AkkaEnvelopePayloadAttribute from Akka.Serialization.V2 - a property whose static type is object (or object?) is now the envelope-payload boundary by itself, with no attribute required. This left two sites in ReliableDeliveryMessagePackSerializer.cs referencing the deleted attribute: SequencedMessageWire.Payload and MessageSentWire.Payload, both already typed object?. Drop the attribute, keep the object? typing, and update the two doc comments that described the old attribute-based mechanism. No wire-format or generated-code change; only the source-gen input annotation moved. Verified: Akka.Cluster and Akka.Cluster.Tests build clean under -warnaserror with no new AKKASGxxx diagnostics; ReliableDeliveryMessagePackSerializerSpecs (82 tests) and the full Akka.Cluster.Tests Serialization filter (154 tests, includes the id 36 -> 76 classic-serializer fork) pass; Akka.Benchmarks builds clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #8384. Implements Decision 20 of the OpenSpec design record (
openspec/changes/messagepack-sourcegen-validation/design.md):[AkkaEnvelopePayload]is removed, and a property typedobjectis the serializer boundary on its own.The static type of a property, after generic substitution, selects its encoding:
objectorobject?: the envelope frame,{1: serializerId, 2: manifest, 3: bytes}, decoded by whatever serializer owns the payload's runtime type.[AkkaUnion]: the union frame.A generic wrapper follows its type argument:
Envelope<object>is a boundary,Envelope<AcceptCassette>is inline.Changes
AkkaEnvelopePayloadAttributedeleted. XML docs onAkkaSerializerupdated.SpecialType.System_Objecton the substituted member type. Attribute detection removed.[AkkaUnion]on anobject-typed property is contradictory intent. Message: "Property '{0}' on type '{1}' is typed object, which is always an envelope payload boundary, but carries a field-level [AkkaUnion]. Type the property as the union's base type, or remove the attribute."SystemMessageEnvelope.Message(ISystemMessagetoobject), benchmarkBenchmarkOuterEnvelope.Inner, and test fixtures; casts added at the consumers that needed them. The envelope nesting-depth guard is untouched.Why
The attribute only ever added a static type to a boundary field. On
dev, eight usages existed: four alreadyobject, two interfaces in a DTO and a spec, two concrete envelope types in nesting tests. All are DTO mirrors or fixtures, where retyping costs almost nothing. Same principle as the rest of the design: the closed set comes from the type, and the open case is explicit because the author wroteobject.Compatibility
No wire-format change: emitted code for an envelope field is byte-identical, and no golden-output or wire-snapshot file changed. The attribute never shipped in a release, so no
BREAKING_CHANGES_V1.6.mdentry. This must land before the first 1.6 beta; after that it would be a breaking change.Akka.Serialization.V2is not covered by the API approval suite, and the retyped Artery type is internal; the approval tests pass unchanged.Testing
dotnet test src/core/Akka.Serialization.V2.Tests -c Release: 268 passed, 0 failed (two AKKASG035 tests removed, one AKKASG038 test added).Akka.Remotebuilds;ArteryControlMessageSerializerSpec32/32. Benchmarks build.Follow-up
The user guide (#8514, merged) documents the attribute as it shipped before this PR and lists this removal under planned changes. A docs PR updates the envelope-payloads section once this merges.