fix: address CodeRabbit review findings across runtime modules

- Extract filterLegacyMpvPluginFileCandidates, buildYomitanAnkiSettingsKey, setMpvCurrentSecondarySubText, runSupportAssetUpdatesForLauncherResult helpers
- Include forceOverride in yomitan anki settings cache key (was missing, causing incorrect cache hits)
- Detect same-PID stale stats daemon state to avoid self-connect
- Validate non-empty extension in buildFfmpegSubtitleExtractionArgs
- Drop unused message param from showOverlayLoadingStatusNotification
- Log and rethrow on session bindings artifact write failure
- Add unit tests for all extracted helpers
This commit is contained in:
2026-06-12 00:36:33 -07:00
parent b9fe555b94
commit 572bdd1cf7
20 changed files with 261 additions and 36 deletions
@@ -0,0 +1,20 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { runSupportAssetUpdatesForLauncherResult } from './update-support-assets-runtime';
test('runSupportAssetUpdatesForLauncherResult logs support-asset errors and preserves launcher result', async () => {
const warnings: string[] = [];
const launcherResult = { status: 'updated' } as const;
const result = await runSupportAssetUpdatesForLauncherResult({
launcherResult,
updateSupportAssets: async () => {
throw new Error('archive failed');
},
logWarn: (message, details) => {
warnings.push(`${message}:${details instanceof Error ? details.message : String(details)}`);
},
});
assert.equal(result, launcherResult);
assert.deepEqual(warnings, ['Support asset update failed after launcher update:archive failed']);
});