fix: restore widest-version base struct alias (#149)#150
Merged
Conversation
v1.2.0 silently regressed the unsuffixed {Message}Data alias to map to
the baseline V0 layout, dropping every field added in later schema
versions. Consumers that read post-V0 fields via the unsuffixed alias
(e.g. SnapshotFullRefresh_Header_30Data.LastSequenceVersion in the B3
UMDF consumer) hit CS1061 after upgrading.
Root cause: while implementing #146 the per-version blockLength compute
for the VersionMap was added at the cost of accidentally removing the
'effectiveVersion' widening introduced in v1.1.4 (#143). The widening
restored — base struct includes all fields up to schema version, while
the VersionMap continues to expose each version's own blockLength.
Updated VersioningIntegrationTests.V0Type_HasOnlyBaseFields (renamed to
V0Type_IsWidestStruct_IncludesAllSinceVersionFields) to reflect the
documented behavior. 187 + 126 tests green.
Closes #149.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Closes #149.
Regressão
v1.2.0 colapsou o alias canônico
{Message}Data(namespace V0) para o layout V0 estrito, removendo todos os campos adicionados em versões posteriores. Consumidores como o B3 UMDF que liam campos pós-V0 pelo alias canônico passaram a quebrar com CS1061 (ex.:SnapshotFullRefresh_Header_30Data.LastSequenceVersion).Causa raiz
Ao implementar #146 (VersionMap), o widening de versão (
effectiveVersion) introduzido em v1.1.4 (#143) foi removido por engano enquanto eu adicionava o cálculo de blockLength por versão. As duas preocupações são independentes:sinceVersion ≤ schemaVersion.Fix
Restaurado o widening apenas para a geração da struct, mantendo a coleta per-versão de blockLength para o VersionMap.
Testes
VersioningIntegrationTests.V0Type_HasOnlyBaseFieldsfoi renomeado paraV0Type_IsWidestStruct_IncludesAllSinceVersionFieldse invertido para refletir o contrato documentado (V0 = 25 bytes no schema de teste, com orderId+price+quantity+side).187 + 126 testes verdes.