feat: make catalog-pages dedup a choosable step in Fix alles
CI / check (push) Successful in 28s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m3s

The maintenance "Fix alles" now has a checkbox to include or skip the
duplicate catalog_pages merge, so admins can choose whether to run it.
removeDuplicates takes an includePages flag and fixEverything threads it
through to the action.
This commit is contained in:
openhands committed 2026-08-24 18:35:00 +02:00
1 parent 6dced0fb54
commit 3a292a44f1
3 files changed
+45 -11

No files matched your search

+10 -4
View File
@@ -388,9 +388,13 @@ async function dedupCatalogTable(table: string): Promise<number> {
* product on the same page). The page merge runs before the row dedup so items
* moved onto the survivor are still de-duplicated within the page afterwards.
*/
export async function removeDuplicates(): Promise<DedupResult> {
export async function removeDuplicates(
includePages = true,
): Promise<DedupResult> {
const ib = await removeDuplicateItemsBase();
const pageDedup = await dedupeCatalogPages();
const pageDedup = includePages
? await dedupeCatalogPages()
: { groups: 0, removed: 0, remapped: 0 };
const catalogRemoved = await dedupCatalogTable("catalog_items");
const catalogBcRemoved = await dedupCatalogTable("catalog_items_bc");
return {
@@ -630,12 +634,14 @@ export interface FixAllResult {
}
/** Run every repair in a sensible order, then return before/after health. */
export async function fixEverything(): Promise<FixAllResult> {
export async function fixEverything(
opts: { dedupePages?: boolean } = {},
): Promise<FixAllResult> {
const healthBefore = await getFurniHealth();
const sprite = await fixSpriteIds();
const offers = await fixCatalogOffers();
const reconcile = await reconcileIds();
const dedup = await removeDuplicates();
const dedup = await removeDuplicates(opts.dedupePages ?? true);
const align = await forceItemsBaseIdsToFurnidata(true);
const healthAfter = await getFurniHealth();
return { healthBefore, sprite, offers, reconcile, dedup, align, healthAfter };