Skip to content

fix(javascript): improve hps string writing - #4098

Merged
chaokunyang merged 2 commits into
apache:mainfrom
pjfanning:fix-js-hps-string-bounds
Sep 30, 2026
Merged

chaokunyang merged 2 commits into
apache:mainfrom
pjfanning:fix-js-hps-string-bounds

Conversation

@pjfanning

Copy link
Copy Markdown
Member

What does this PR do?

Improves how the JavaScript hps string writer handles buffers:

  • BinaryWriter reserves space before using the hps string path.
  • The @apache-fory/hps wrapper validates the destination buffer.
  • The native writer respects the Uint8Array view offset.

Adds tests in test/hps.test.ts.

Note: the hps addon only builds on Node 20, and the JS CI matrix runs Node 18 and 24, so the hps tests are skipped in CI. Verified locally with npm test on Node 20 (391 tests passed).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chaokunyang
chaokunyang merged commit 341f732 into apache:main Sep 30, 2026
82 checks passed
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.

2 participants