Harden deploy gates, prod AUTH_SECRET, and Sentry error reporting.
Local Build and Deploy / deploy (push) Successful in 1m42s

Align onlyBuiltDependencies with the workspace, fail fast without AUTH_SECRET in production, and delete catalog_items via VARCHAR-safe SQL so page deletes do not leave orphans.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-07-18 19:32:15 +02:00
1 parent b9c6001f08
commit 6b884ad25a
12 files changed
+128 -50

No files matched your search

+15 -2
View File
@@ -204,6 +204,19 @@ export async function movePage(
});
}
/**
* Delete catalog_items for the given page ids.
* Habbo DBs often store page_id as VARCHAR; Prisma Int deleteMany misses rows.
*/
async function deleteCatalogItemsByPageIds(pageIds: number[]): Promise<void> {
if (pageIds.length === 0) return;
const idStrs = pageIds.map(String);
await prisma.$executeRaw`
DELETE FROM catalog_items
WHERE CAST(page_id AS CHAR) IN (${Prisma.join(idStrs)})
`;
}
/**
* Delete a page with cascade or reparent mode.
*/
@@ -223,7 +236,7 @@ export async function deletePage(
data: { parentId: page.parentId },
});
await prisma.catalogItems.deleteMany({ where: { pageId } });
await deleteCatalogItemsByPageIds([pageId]);
await prisma.catalogPages.delete({ where: { id: pageId } });
return { deletedPages: 1, movedChildren: result.count };
@@ -249,7 +262,7 @@ async function cascadeDelete(pageId: number): Promise<number> {
}
}
await prisma.catalogItems.deleteMany({ where: { pageId: { in: toDelete } } });
await deleteCatalogItemsByPageIds(toDelete);
for (let i = toDelete.length - 1; i >= 0; i--) {
await prisma.catalogPages.delete({ where: { id: toDelete[i] } });
}