Skip to content

Navigation Menu

Sign in
Sign up

0.2.1 — append Config's new fields instead of inserting them - #6

Merged
Halloweedev merged 1 commit into
main from
fix/config-field-order
Sep 5, 2026
Merged

0.2.1 — append Config's new fields instead of inserting them #6
Halloweedev merged 1 commit into
main from
fix/config-field-order

Conversation

@Halloweedev

@Halloweedev Halloweedev commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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 — appending costs the same. This repo already documents the rule twice, on State::FreeTier and State::Limited; Config now 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

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>
Halloweedev merged commit 6894309 into main Sep 5, 2026
14 checks passed
Halloweedev deleted the fix/config-field-order branch September 5, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /