File tree Expand file tree Collapse file tree
services/libs/data-access-layer/src/packages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,7 +184,13 @@ export async function findRemovedAdvisoryPackageIds(
184184 ` ,
185185 { advisoryId, presentAdvisoryPackageIds } ,
186186 )
187- return rows . map ( ( r : { id : number } ) => r . id )
187+ // advisory_packages.id is bigint (oid 20) — the pg connection only installs a
188+ // numeric type parser for int4 (services/libs/database/src/connection.ts:84-85),
189+ // so node-pg returns this column as a string. Convert explicitly so the
190+ // declared number[] return type is actually true — a bare cast would leave the
191+ // subtraction-based sort in upsertAdvisory.ts relying on implicit string-to-
192+ // number coercion, which loses precision once ids exceed Number.MAX_SAFE_INTEGER.
193+ return rows . map ( ( r : { id : string } ) => Number ( r . id ) )
188194}
189195
190196// Diff-based upsert + soft-delete for OSV-owned advisory_affected_ranges rows.
You can’t perform that action at this time.
0 commit comments