From b938496781e65d427a29db973f4a868f4beb6a22 Mon Sep 17 00:00:00 2001 From: Tim Evans Date: Wed, 4 Mar 2026 19:58:40 +0000 Subject: [PATCH] fix: isolate per-actor SLA skill sync failures and bump system cache version --- sla-industries-brp/module/actor/actor.mjs | 27 ++++++++++++++++------- sla-industries-brp/system.json | 2 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/sla-industries-brp/module/actor/actor.mjs b/sla-industries-brp/module/actor/actor.mjs index 13db80c..312ce27 100644 --- a/sla-industries-brp/module/actor/actor.mjs +++ b/sla-industries-brp/module/actor/actor.mjs @@ -827,23 +827,34 @@ export class BRPActor extends Actor { let created = 0 let removed = 0 const missing = new Set() + const failed = [] for (const actor of actors) { - const result = await BRPActor.ensureSLASkillRoster(actor, { - includeEbb: SLAEbbSystem.isEbbSpecies(actor), - pruneEbbForNonEligible: true - }) - created += Number(result?.created ?? 0) - removed += Number(result?.removed ?? 0) - for (const row of result?.missing ?? []) missing.add(String(row)) + try { + const result = await BRPActor.ensureSLASkillRoster(actor, { + includeEbb: SLAEbbSystem.isEbbSpecies(actor), + pruneEbbForNonEligible: true + }) + created += Number(result?.created ?? 0) + removed += Number(result?.removed ?? 0) + for (const row of result?.missing ?? []) missing.add(String(row)) + } catch (err) { + failed.push(String(actor?.name ?? actor?.id ?? "unknown")) + console.warn("sla-industries-brp | SLA roster sync failed for actor", { + actor: actor?.name, + actorId: actor?.id, + err + }) + } } - const summary = { actors: actors.length, created, removed, missing: [...missing] } + const summary = { actors: actors.length, created, removed, missing: [...missing], failed } if (notify && (created > 0 || removed > 0 || summary.missing.length > 0)) { const parts = [] if (created > 0) parts.push(`${created} added`) if (removed > 0) parts.push(`${removed} removed`) if (summary.missing.length > 0) parts.push(`${summary.missing.length} unresolved refs`) + if (summary.failed.length > 0) parts.push(`${summary.failed.length} actor failures`) ui.notifications.info(`SLA skill roster sync: ${parts.join(", ")}.`) } return summary diff --git a/sla-industries-brp/system.json b/sla-industries-brp/system.json index 8fcf65f..2703eda 100644 --- a/sla-industries-brp/system.json +++ b/sla-industries-brp/system.json @@ -2,7 +2,7 @@ "id": "sla-industries-brp", "title": "SLA Industries BRP (Draft)", "description": "Draft SLA Industries conversion of the BRP system for FoundryVTT.", - "version": "13.1.52", + "version": "13.1.53", "compatibility": { "minimum": "13", "verified": "13.350",