Skip to content

Conversation

@AlexanderKolberg
Copy link
Contributor

This fixes two issues

  1. Nested arrays weren't decoding correctly - Arrays like Message[] with BigInt fields failed because the [] suffix wasn't stripped during recursion
  2. JsonEncode was mutating original request objects - Switched to using a custom replacer function with JSON.stringify instead, which is much simpler and doesn't mutate the caller's object. This removes the need to manually transverse the object, and removes the need for the BIG_INT_FIELDS when encoding (its still needed for decoding), it will just encode every Value with type of Bigint as string

Added unit tests for the above. in a separate directory for now, will move them with the other tests in a follow-up PR

Copy link
Member

@pkieltyka pkieltyka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed with Alex, looks good

@pkieltyka pkieltyka marked this pull request as draft November 12, 2025 14:20
@pkieltyka pkieltyka marked this pull request as ready for review November 12, 2025 15:38
@pkieltyka pkieltyka merged commit 3ca2d89 into master Nov 12, 2025
1 check passed
@pkieltyka pkieltyka deleted the bigint-array branch November 12, 2025 15:38
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.

3 participants