Skip to content

v0.2.1

Choose a tag to compare

@RezaKargar RezaKargar released this 15 Feb 20:24
· 5 commits to main since this release

Bug Fix

  • fix: do not register TypeStringEmpty in string dedup table — PHP igbinary treats TypeStringEmpty (0x0D) as a special marker that does not occupy a slot in the string deduplication table. The previous implementation incorrectly registered empty strings in both decodeValue() and decodeArrayKey(), causing all subsequent StringID lookups to be off by one whenever an empty string appeared in the data. This manifested as corrupted keys in structures like badge payloads where empty string values are common and later entries reference previously registered strings by ID.

Tests

  • Added 4 test cases covering the empty string dedup table behavior:
    • TestEmptyStringValueDoesNotShiftStringIDs — empty value followed by StringID reference
    • TestEmptyStringKeyDoesNotShiftStringIDs — empty key followed by StringID reference
    • TestMultipleEmptyStringsDoNotShiftStringIDs — multiple empty strings (key + value)
    • TestEmptyStringInNestedStructDoesNotShiftStringIDs — real-world badge-like nested structure

CI

  • Fixed Go version in test matrix (1.25 → 1.26) to match go.mod requirement
  • Fixed gofmt alignment in test cases