Skip to content

Commit c261234

Browse files
Fix difficulty tier query for skull hashes above int32 max. (#134)
Casting skull_hash to int in loadKnownFeatSkulls failed for uint32 values like 3975235718, breaking /history and /instance after Pantheon 2.0 deploy. Use bigint + convertUInt32Value like the manifest feat loader. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fd1b7f1 commit c261234

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/services/difficulty-tier/resolve.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { pgReader } from "@/integrations/postgres"
2+
import { convertUInt32Value } from "@/integrations/postgres/transformer"
23
import { DifficultyTier } from "@/schema/enums/DifficultyTier"
34
import { activityHasTierCollection, classifyDifficultyTier } from "./classify"
45

@@ -11,10 +12,13 @@ async function loadKnownFeatSkulls(
1112
}
1213

1314
const rows = await pgReader.queryRows<{ skullHash: number }>(
14-
`SELECT skull_hash::int AS "skullHash"
15+
`SELECT skull_hash AS "skullHash"
1516
FROM activity_feat_definition
1617
WHERE skull_hash = ANY($1::bigint[])`,
17-
{ params: [unique] }
18+
{
19+
params: [unique],
20+
transformers: { skullHash: convertUInt32Value }
21+
}
1822
)
1923

2024
return new Set(rows.map(row => row.skullHash))

0 commit comments

Comments
 (0)