mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-30 18:10:04 +08:00
refactor(backend): specta ipc bindings (#8195)
* refactor(ipc): generate bindings with Specta * fix(profile): project IPC inputs to consumed fields * fix(events): remove unused refresh payloads * fix(webdav): return only consumed backup metadata * fix(network): trim unused interface metadata * fix(sysinfo): return only displayed system fields * chore(knip): check generated runtime exports * fix(proxy): confirm runtime chain updates before UI changes * fix(clipboard): propagate proxy environment copy failures * refactor(dns): remove ignored runtime patch * refactor(core): trim unused upgrade response fields * refactor(ipc): avoid redundant response copies * refactor(proxy): clarify automatic proxy query naming * chore(tests): remove added IPC regression tests * refactor(ipc): enforce typed command boundaries * chore(contract): check generated bindings before push * refactor(ipc): remove unused proxy liveness payloads
This commit is contained in:
@@ -53,16 +53,17 @@ const migrating = new Set<string>()
|
||||
|
||||
export function migrateProfileTestUrls(profiles: IProfilesConfig) {
|
||||
for (const profile of profiles.items || []) {
|
||||
if (profile.latency_test_urls !== undefined || migrating.has(profile.uid))
|
||||
continue
|
||||
const urls = readLegacyTestUrls(profile.uid)
|
||||
const uid = profile.uid
|
||||
if (!uid) continue
|
||||
if (profile.latency_test_urls !== undefined || migrating.has(uid)) continue
|
||||
const urls = readLegacyTestUrls(uid)
|
||||
if (!Object.keys(urls).length) continue
|
||||
migrating.add(profile.uid)
|
||||
void saveProfileTestUrls(profile.uid, urls, true)
|
||||
migrating.add(uid)
|
||||
void saveProfileTestUrls(uid, urls, true)
|
||||
.catch((error) => {
|
||||
console.error('Failed to migrate latency test URLs:', error)
|
||||
})
|
||||
.finally(() => migrating.delete(profile.uid))
|
||||
.finally(() => migrating.delete(uid))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,10 +93,9 @@ export function profileTestUrls(profile: IProfileItem): Record<string, string> {
|
||||
return {
|
||||
...profile.latency_test_urls,
|
||||
...Object.fromEntries(
|
||||
Object.entries(pending.get(profile.uid) ?? {}).map(([group, edit]) => [
|
||||
group,
|
||||
edit.url,
|
||||
]),
|
||||
Object.entries(
|
||||
(profile.uid ? pending.get(profile.uid) : undefined) ?? {},
|
||||
).map(([group, edit]) => [group, edit.url]),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user