fix(serialization): defer interface collection codec dependencies - #10301
Merged
ReubenBond merged 1 commit intoJul 30, 2026
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a regression introduced in Orleans 10.2 where interface collection codecs eagerly resolve element codecs, causing IList<SequentialItem<T>> codec resolution to fail because SequentialItem<T> was not marked as serializable.
Changes:
- Mark
SequentialItem<T>as a generated-serializable type with stable member IDs. - Add a regression test which validates codec resolution for
SequentialItem<T>andIList<SequentialItem<T>>, plus a simple round-trip serialization check.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.Core.Tests/Serialization/BuiltInSerializerTests.cs | Adds regression coverage for SequentialItem<T> and interface-list codec resolution plus a round-trip check. |
| src/Orleans.Streaming/Core/IAsyncBatchObserver.cs | Annotates SequentialItem<T> with [GenerateSerializer] and stable [Id] attributes so codecs can be generated/resolved. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
test/Orleans.Serialization.UnitTests/InterfaceCollectionCodecTests.cs:549
classdeclarations in C# require a body;public sealed class UnsupportedElement;will not compile. Use an empty body instead.
public sealed class UnsupportedElement;
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
ReubenBond
force-pushed
the
reubenbond-fix-codec-regression-10300
branch
from
July 30, 2026 20:23
d247633 to
56fe38d
Compare
ReubenBond
force-pushed
the
reubenbond-fix-codec-regression-10300
branch
from
July 30, 2026 21:04
56fe38d to
d0ce381
Compare
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (2)
src/Orleans.Streaming/Core/IAsyncBatchObserver.cs:28
SequentialItem<T>.Itemno longer has an[Id]attribute. This changes the serialized schema and will break compatibility with previously serialized payloads and existing generated-code expectations for this type.
/// <value>The item.</value>
public T Item { get; }
src/Orleans.Streaming/Core/IAsyncBatchObserver.cs:35
SequentialItem<T>.Tokenno longer has an[Id]attribute. This changes the serialized schema and will break compatibility with previously serialized payloads and existing generated-code expectations for this type.
public StreamSequenceToken Token { get; }
}
- Files reviewed: 3/3 changed files
- Comments generated: 2
Comment on lines
10
to
12
| /// <typeparam name="T">The item type.</typeparam> | ||
| [GenerateSerializer] | ||
| public class SequentialItem<T> | ||
| { |
Keep fallback codec services lazy so interface collection codecs can select a concrete runtime codec before resolving fallback element codecs. Preserve the existing interface codec wire type and cover generated null fields and custom concrete collection codecs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8c9979b4-a5d3-45d0-8c6b-118d500f9ff7
ReubenBond
force-pushed
the
reubenbond-fix-codec-regression-10300
branch
from
July 30, 2026 21:10
d0ce381 to
22170f3
Compare
This was referenced Aug 28, 2026
This was referenced Aug 29, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #10300
Orleans 10.2 interface collection codecs eagerly unwrapped their fallback element codecs during construction. A generated type containing an interface collection field could therefore fail while its codec was being constructed—even when the field was null—because the interface codec resolved an unavailable element codec before any runtime collection value existed.
Keep the injected fallback codec holders lazy so concrete runtime codecs are resolved first and null fields require no element codec. Preserve the existing interface codec type as the fallback wire-format identity, and cover both generated null-field and custom concrete-runtime-codec scenarios.