fix(main): W1 四项修复

- updater: applyUpdateSchedule 记忆 interval,未变化不重建定时器
- updater: startupArmed 进程首次调用即消费,中途拨开只影响周期定时器
- settingsStore: LEGACY_BUILTIN_PATTERNS 补 url 预设(唯一漏登记项)
- release.cjs: --channel-only 与 --skip-gitea 组合 fail-fast exit 1
This commit is contained in:
Bill committed 2026-10-21 23:02:22 +08:00
1 parent 9036bea6f3
commit 69d24fbed6
5 files changed
+147 -23

No files matched your search

+17
View File
@@ -493,6 +493,15 @@ console.log('[preset refresh]')
okstate?.priority === 10 && okstate?.color.fg === '#123456' && okstate?.enabled === true,
'a refreshed rule keeps the priority, colour and switch the user left it at'
)
// The very first url preset (https?:// only, widened by ftp/www alternation
// later) is a registered legacy pattern too — an early install upgrades
// exactly like okstate above. This regressed silently before the url entry
// was added to LEGACY_BUILTIN_PATTERNS.
const url = upgraded.find((r) => r.id === 'url')
ok(
typeof url?.pattern === 'string' && url.pattern.includes('ftp://') && url.pattern !== V1.url,
'the early url preset (https?:// only) is refreshed to the current one'
)
const addedSince = [
'warnstate',
'danger',
@@ -524,6 +533,14 @@ console.log('[preset refresh]')
'a hand-edited built-in rule is left alone'
)
// The legacy url pattern on a NON-builtin rule must not be refreshed either.
const nonBuiltin = v1Set().map((r) => (r.id === 'url' ? { ...r, builtin: false } : r))
const afterNonBuiltin = (await roundTrip({ highlightRules: nonBuiltin })).highlightRules
ok(
afterNonBuiltin.find((r) => r.id === 'url')?.pattern === V1.url,
'the legacy url pattern on a non-builtin rule is left alone'
)
// ...and so must a rule the user deleted: it must not come back.
const pruned = v1Set().filter((r) => r.id !== 'numbers')
const afterPrune = (await roundTrip({ highlightRules: pruned })).highlightRules