From 56bfa164a105efcb064acef4d409fcb1fa9f1bd4 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 20 Aug 2026 15:09:18 +0200 Subject: [PATCH] feat: set interaction_type at import and track cross-section normalizations Newly imported items with a generic .nitro logicType stayed on interaction_type 'default' until the post-import verification sweep ran. Fall back to the same auto-detected type used by the sweep (classname mechanic + keyword + real flags) so imports carry the correct interaction immediately; updates keep their existing emulator handler types. Also count cross-section id alignments under a separate normalizedIds field in reconcileFurniDataWithItemsBase so fixedIds keeps its original meaning. --- src/lib/services/furni-data.ts | 7 +++++-- src/lib/services/furni-import.ts | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/services/furni-data.ts b/src/lib/services/furni-data.ts index e09f1805..322759f0 100644 --- a/src/lib/services/furni-data.ts +++ b/src/lib/services/furni-data.ts @@ -449,6 +449,8 @@ export interface FurniDataReconcileResult { fixedIds: number; /** Entries whose stale offerid was corrected to the DB id. */ fixedOfferIds: number; + /** Cross-section copies (same classname in both sections) whose stale id was aligned to their offerid. */ + normalizedIds: number; /** items_base rows with no matching furnitype entry (need re-import). */ missing: number; /** spriteIds used by a different classname in the file; left untouched. */ @@ -503,6 +505,7 @@ export async function reconcileFurniDataWithItemsBase(): Promise 0 || fixedOfferIds > 0) { await writeFurniData(furniData as Record); } - return { fixedIds, fixedOfferIds, missing, conflicts }; + return { fixedIds, fixedOfferIds, normalizedIds, missing, conflicts }; }); } diff --git a/src/lib/services/furni-import.ts b/src/lib/services/furni-import.ts index 4e9af034..903f1e0f 100644 --- a/src/lib/services/furni-import.ts +++ b/src/lib/services/furni-import.ts @@ -908,6 +908,19 @@ export async function importSingleFurni(params: { }); const interactionModesCount = autoInteraction.interactionModesCount; + // When the .nitro logicType produced no specific handler, fall back to the + // auto-detected type (classname mechanic + keyword + real flags) exactly + // like the post-import verification sweep, so newly imported items carry the + // correct interaction_type immediately instead of waiting for the sweep. + // Never applied to updates — existing emulator handler types must survive. + if ( + !isUpdate && + interactionType === "default" && + autoInteraction.interactionType !== "default" + ) { + interactionType = autoInteraction.interactionType; + } + // Update items_base with ALL enriched data try { const update = buildItemsBaseEnrichmentUpdate({