Skip to content

sdks/ts: fix serializer bugs and agentError null crash#2855

Merged
Myestery merged 2 commits intomainfrom
fix/sdks-ts-serializer-bugs
Mar 5, 2026
Merged

sdks/ts: fix serializer bugs and agentError null crash#2855
Myestery merged 2 commits intomainfrom
fix/sdks-ts-serializer-bugs

Conversation

@Myestery
Copy link
Contributor

@Myestery Myestery commented Mar 2, 2026

Summary

  • Fix missingObjectKey argument swap: arguments were reversed (tsValue, 'tag')('tag', tsValue), producing wrong error messages
  • Fix handleObjectMatch null check: was comparing to string literal 'interface' instead of checking for null
  • Fix u64 BigInt conversion: properly convert number to BigInt instead of casting as any
  • Add null guards in serializeTsValueToBinaryReference and serializeTsValueToTextReference (typeof null === 'object' was passing the guard)
  • Fix isAgentError crash on null input: add null/non-object guard before accessing properties

Context

Split from #2845 — this PR contains only the bug fixes, no lint rule changes or type refactoring.

Test plan

  • Existing SDK tests pass
  • Manual verification that isAgentError(null) returns false instead of crashing
  • Serializer correctly handles missingObjectKey error messages

- Fix missingObjectKey argument swap: arguments were reversed (tsValue, 'tag') → ('tag', tsValue)
- Fix handleObjectMatch null check: was comparing to string literal 'interface' instead of checking for null
- Fix u64 BigInt conversion: properly convert number to BigInt instead of casting as any
- Add null guards in serializeTsValueToBinaryReference and serializeTsValueToTextReference (typeof null === 'object' was passing the guard)
- Fix isAgentError crash on null input: add null/non-object guard before accessing properties
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

✅ All contributors have signed the CLA.
Posted by the CLA Assistant Lite bot.

@Myestery
Copy link
Contributor Author

Myestery commented Mar 5, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Mar 5, 2026
@Myestery Myestery merged commit 048bf0a into main Mar 5, 2026
27 of 28 checks passed
@Myestery Myestery deleted the fix/sdks-ts-serializer-bugs branch March 5, 2026 15:51
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants