-
Notifications
You must be signed in to change notification settings - Fork 0
0.2.1 — append Config's new fields instead of inserting them - #6
Merged
Merged
Conversation
0.2.0 added requireSignedConfig and keylessHeartbeatIntervalMs in the MIDDLE of
Config, ahead of autoValidationIntervalMs. Positional aggregate initialisation
binds by position, so `Config cfg{"tenant", "product", ..., 60000}` written
against 0.1.6 either shifted every value after the insertion point or stopped
compiling — a break bought for nothing, since appending costs the same.
This repo already documents the rule twice, on State::FreeTier and
State::Limited, for exactly this reason. I did not follow it on Config. The
struct now carries the same note, so the next field goes on the end.
Nothing else changes: same fields, same names, same defaults, same behaviour.
Only positional aggregate initialisation was ever affected, and the documented
style is field assignment. Anyone still on 0.1.6 should upgrade straight to
0.2.1 and skip the question.
The porting handoff gains this as a fourth trap, since the rule holds in the
other SDKs through different mechanisms: Swift's memberwise initialiser takes
arguments in declaration order, and in Rust adding a public field at all breaks
construction without ..Default::default() unless the struct is non_exhaustive.
JS and C# are name-based and unaffected.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
0.2.0 added
requireSignedConfigandkeylessHeartbeatIntervalMsin the middle ofConfig, ahead ofautoValidationIntervalMs. Positional aggregate initialisation binds by position, soConfig cfg{"tenant", "product", ..., 60000}written against 0.1.6 either shifted every value after the insertion point or stopped compiling.A break bought for nothing — appending costs the same. This repo already documents the rule twice, on
State::FreeTierandState::Limited;Confignow carries the same note so the next field goes on the end.Nothing else changes: same fields, names, defaults and behaviour. Only positional aggregate initialisation was ever affected, and the documented style is field assignment. Anyone still on 0.1.6 should upgrade straight to 0.2.1.
Also adds this as a fourth trap in the porting handoff — the rule holds in the other SDKs through different mechanisms. Swift's memberwise initialiser takes arguments in declaration order; in Rust, adding a public field at all breaks construction without
..Default::default()unless the struct is#[non_exhaustive]. JS and C# are name-based and unaffected.🤖 Generated with Claude Code