Skip to content

Fix BigInt serialization error in lookup table test flow#25396

Merged
danotorrey merged 1 commit intomasterfrom
fix/bigint-lookup-table-serialization
Mar 20, 2026
Merged

Fix BigInt serialization error in lookup table test flow#25396
danotorrey merged 1 commit intomasterfrom
fix/bigint-lookup-table-serialization

Conversation

@danotorrey
Copy link
Contributor

@danotorrey danotorrey commented Mar 20, 2026

Summary

  • DataAdapter.tsx and test-lookup.tsx used native JSON.stringify to display lookup results, which throws TypeError: Do not know how to serialize a BigInt
  • PR Deserialize big numbers in frontend to BigInt. #23432 changed FetchProvider.ts to parse API responses with JSONParse from json-with-bigint (large numbers become BigInt), but these two files were not update)
  • The AD adapter is specifically affected because it returns values like accountExpires: 9223372036854775807 (Long.MAX_VALUE) which exceed Number.MAX_SAFE_INTEGER
  • standard ttl field for any adapter was also affected.
  • Replaced JSON.stringify with JSONStringify from json-with-bigint in both files
  • Added a regression test that verifies BigInt values render without crashing

Error when looking up adapter cal

image

Appears to have been introduced when #23432 was merged.

/nocl fixed unreleased error

Test plan

  • Configure an Active Directory User Lookup data adapter pointing at an AD server
  • Perform a test lookup — verify the result displays without crashing
  • Verify the lookup table test page (test-lookup.tsx) also handles BigInt values
  • Run npx jest -- 'components/lookup-tables/DataAdapter.test.tsx' — all tests pass

🤖 Generated with Claude Code

PR #23432 introduced json-with-bigint for deserializing large numbers as
BigInt, but DataAdapter.tsx and test-lookup.tsx still used native
JSON.stringify which cannot serialize BigInt values. This causes a
TypeError when displaying lookup results containing large AD timestamps
like accountExpires or pwdLastSet.

Replace JSON.stringify with JSONStringify from json-with-bigint in both
lookup table test/preview pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Contributor

@ryan-carroll-graylog ryan-carroll-graylog left a comment

Choose a reason for hiding this comment

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

Looks good and tests successfully! Nice job on the quick fix/troubleshooting Dan!

@danotorrey danotorrey changed the title Fix BigInt serialization crash in lookup table test pages Fix BigInt serialization error in lookup table test flow Mar 20, 2026
@danotorrey danotorrey merged commit 01b4c53 into master Mar 20, 2026
37 of 39 checks passed
@danotorrey danotorrey deleted the fix/bigint-lookup-table-serialization branch March 20, 2026 22:11
@danotorrey
Copy link
Contributor Author

FYI @dennisoelkers this came up with some testing of the latest field expansion enhancements for the AD adapter. Let me know if you see any issues here.

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