GPT-5 finding
BigInt columns are mapped as JavaScript number, risking precision loss for GitHub IDs and comment IDs
highdata-losshigh
- apps/web/db/schema.ts:36-37
- apps/web/db/schema.ts:44-45
- apps/web/db/schema.ts:120-121
- apps/web/db/schema.ts:176-177
- apps/web/db/schema.ts:192-193
JavaScript numbers cannot precisely represent all 64-bit integers (safe up to 2^53-1). GitHub installation IDs and comment IDs are 64-bit and can exceed this range. Using mode: "number" risks rounding on read/write, corrupting identifiers and breaking lookups or API calls that depend on exact IDs.
Recommendation
Switch bigint columns to mode: "string" (or store as text) to preserve precision. Update types and call sites to handle string IDs when interacting with GitHub or logs. Consider adding runtime validation to ensure IDs remain within JS safe range if you must use numbers.