mihomo-party-org/clash-party · warning

[ProfileUpdater] Failed to audit plugin vault ${item.pluginI

Error message

[ProfileUpdater] Failed to audit plugin vault ${item.pluginId}:

What it means

auditPluginProfileVault wraps auditPluginVault(item.pluginId) (dynamically imported from ../resolve/plugin) in try/catch and logs this warning on any rejection. The profile item of type 'plugin' still gets processed; only the security/integrity audit of its plugin vault did not run.

Source

Thrown at src/main/core/profileUpdater.ts:57

      // 动态 import 避免与 window.ts 形成静态循环依赖
      const { mainWindow } = await import('../window')
      mainWindow?.webContents.send('profileConfigUpdated')
    } else if (item && item.type === 'plugin' && item.pluginId) {
      const { updatePluginProfile } = await import('../resolve/plugin')
      await updatePluginProfile(item.pluginId)
    }
  } finally {
    updatingProfileIds.delete(id)
  }
}

async function auditPluginProfileVault(item: IProfileItem): Promise<void> {
  if (item.type !== 'plugin' || !item.pluginId) return
  try {
    const { auditPluginVault } = await import('../resolve/plugin')
    await auditPluginVault(item.pluginId)
  } catch (e) {
    await logger.warn(`[ProfileUpdater] Failed to audit plugin vault ${item.pluginId}:`, e)
  }
}

function updateTask(itemId: string, logLabel: string): () => Promise<void> {
  return async () => {
    try {
      await updateProfile(itemId)
    } catch (e) {
      await logger.warn(`[ProfileUpdater] Failed to update ${logLabel}:`, e)
    }
  }
}

function scheduleProfileUpdate(item: IProfileItem): void {
  if ((item.type !== 'remote' && item.type !== 'plugin') || !item.autoUpdate || !item.interval)
    return

  const itemId = item.id

View on GitHub (pinned to 911e090537)

Solutions

  1. Inspect the logged error `e` to see whether the import or the audit failed, and fix the underlying plugin/vault state.
  2. Reinstall or re-import the plugin so its vault exists and matches item.pluginId.
  3. If the plugin is obsolete, remove the stale plugin-type profile item so the audit is skipped legitimately (the guard returns early only when type!=='plugin' or pluginId is empty).

Example fix

// before
await auditPluginVault(item.pluginId)
// after
const exists = await pluginStore.has(item.pluginId)
if (!exists) {
  logger.warn(`Skipping audit; plugin ${item.pluginId} missing from store`)
  return
}
await auditPluginVault(item.pluginId)
Defensive patterns

Strategy: try-catch

Validate before calling

if (item.type !== 'plugin' || !item.pluginId) return
if (!(await pluginStore.has(item.pluginId))) {
  logger.warn(`plugin ${item.pluginId} missing; skipping audit`)
  return
}

Type guard

const isPluginItem = (i: IProfileItem): i is IProfileItem & { type: 'plugin'; pluginId: string } =>
  i.type === 'plugin' && typeof i.pluginId === 'string' && i.pluginId.length > 0

Try / catch

try {
  const { auditPluginVault } = await import('../resolve/plugin')
  await auditPluginVault(item.pluginId)
} catch (e) {
  logger.warn(`[ProfileUpdater] Failed to audit plugin vault ${item.pluginId}:`, e)
}

Prevention

When it happens

Trigger: addProfileUpdater / initProfileUpdater encounters a profile item with type==='plugin' and a pluginId, and auditPluginVault rejects — e.g. the plugin module fails to import, the vault files are missing/corrupt, or the plugin id no longer exists in the store.

Common situations: Plugin deleted or renamed on disk while profile entries still reference its id; corrupted plugin vault after an app update; dynamic import blocked by packaging (asar) issues in built binaries.

Related errors


AI-assisted analysis of mihomo-party-org/clash-party@911e090537 (2026-08-30). Data as JSON: /api/errors/a4fbc5eb44faca56. Report an issue: GitHub.