Document JSON integer precision limitations #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fa2json uses
%llifor the event mask (__u64) and%lifor timestamps. JavaScript'sJSON.parsecannot safely represent integers larger thanNumber.MAX_SAFE_INTEGER(2^53 - 1).In practice current mask values are small and safe, but this is a latent bug worth documenting — and potentially fixing by outputting large integers as strings, or advising consumers to use a BigInt-aware JSON parser.
I think the best bet here is actually to split it into two u32 fields because if we output as string we risk making the problem a silent precision loss during string ingestion.