Closed ZachBray closed 7 months ago
@ZachBray LGTM but the C# tests fail.
@ZachBray
Error Message:
Test method Org.SbeTool.Sbe.Tests.FieldAccessOrderCheckTests.AllowsOldDecoderToSkipAddedPrimitiveFieldBeforeGroup threw exception:
Microsoft.VisualStudio.TestPlatform.TestHost.DebugAssertException: Method Debug.Fail failed with '
', and was translated to Microsoft.VisualStudio.TestPlatform.TestHost.DebugAssertException to avoid terminating the process hosting the test.
Stack Trace:
at Org.SbeTool.Sbe.Tests.FieldAccessOrderCheckTests.ModifyHeaderToLookLikeVersion1() in /home/runner/work/simple-binary-encoding/simple-binary-encoding/csharp/sbe-tests/FieldAccessOrderCheckTests.cs:line 3197
at Org.SbeTool.Sbe.Tests.FieldAccessOrderCheckTests.AllowsOldDecoderToSkipAddedPrimitiveFieldBeforeG
Relates to issue #988.
An SBE message might not change in every version of a schema. For example, another message might change.
Previously, the field precedence checking model would expect an exact match for
actingVersion
inwrap
to enter one of its initial states. However, it is only aware of the versions in which a message schema has changed. Therefore, it was possible foractingVersion
not to match any of these versions, in which case the initial state that represented a codec wrapped around the latest known version of the format was picked.Now, we do not expect an exact match in
wrap
. Instead, we select the "best" match. For example, if a codec was changed in v1 and v3, and the acting version is v2, we will decode using v1. However, if the acting version is v4, we would decode as v3.