Skip to content

Release1.1.0#8

Merged
lupodevelop merged 2 commits intomainfrom
release1.1.0
Mar 20, 2026
Merged

Release1.1.0#8
lupodevelop merged 2 commits intomainfrom
release1.1.0

Conversation

@lupodevelop
Copy link
Owner

This pull request introduces several important bug fixes and improvements to the Thrift Compact Protocol implementation, focusing on wire-format correctness and API reliability. The main changes address encoding/decoding issues for field headers and sequence IDs, update documentation, and remove unused code. These updates ensure compatibility with other Thrift implementations and improve the robustness of the library.

Wire-format correctness and protocol compliance:

  • Fixed long-form field header encoding/decoding to use zigzag i16 followed by varint, per Thrift Compact Protocol spec, ensuring interoperability with other implementations (src/thrifty/field.gleam). [1] [2] [3]
  • Corrected sequence ID handling in message headers: sequence IDs are now encoded as unsigned 32-bit two's-complement varints, matching the reference Java implementation; decoding properly sign-extends negative values (src/thrifty/message.gleam). [1] [2]

API correctness and safety:

  • Added explicit checks and panics for invalid values in varint and integer encoding/decoding functions to prevent silent truncation or acceptance of out-of-range values.

Documentation improvements:

  • Moved misplaced doc comments to precede function definitions, ensuring correct documentation generation and clarity (src/thrifty/field.gleam, src/thrifty/message.gleam). [1] Fb154735L160R170, [2] [3] [4] [5]

Dead code removal:

  • Removed the unused types.Writer type from the codebase.

Changelog and test coverage:

  • Added a detailed CHANGELOG.md documenting all notable fixes, API changes, and test additions for this release.

These changes collectively improve correctness, interoperability, and maintainability of the project.

Fix several correctness bugs in encoding/decoding and tighten validations; add tests and CI workflows.

Key fixes:
- Compact field headers: long-form field IDs are now zigzag-encoded when written and decoded with zigzag on read (field.gleam).
- Message sequence IDs: encode as uint32 (mask) and sign-extend on decode to preserve negative seqids (message.gleam).
- Varint: encode_varint now panics on negative inputs; decoder/encoder helpers clarified (varint.gleam).
- Integer read/write fixes: read_i8 now decodes signed bytes; write_i8 and write_i16 validate ranges and panic on overflow (reader.gleam, writer.gleam).
- Boolean policy: AcceptBoth now accepts legacy 0 => False in addition to canonical encoding; added tests for permissive behavior (reader.gleam, types.gleam, tests).
- Misc: remove unused Writer type, add/clean up helper functions, move/clarify doc comments, and provide clearer error formatting for zigzag range errors.

Tests added/updated to cover negative i8/i16 roundtrips, long-form/negative field IDs, negative sequence IDs, and boolean behavior. CI: new workflows for goldens, long fuzz harness, and tag-based publish with improved Hex diagnostics and non-interactive auth; CHANGELOG.md added documenting the fixes.
Delete two GitHub Actions workflows used to publish packages to Hex: .github/workflows/publish-gleam.yml and .github/workflows/publish-on-ci-main.yml. Both workflows (tag-triggered publish pipelines for Gleam and rebar3/CI-based publishing) have been removed, consolidating or replacing the repository's publish automation elsewhere.
@lupodevelop lupodevelop merged commit 25a90b0 into main Mar 20, 2026
1 check passed
@lupodevelop lupodevelop deleted the release1.1.0 branch March 20, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant