fix(core): восстановление дефолта hide_urltest_group_outbounds и ассертов urltest_groups

This commit is contained in:
Dushnilin
2026-08-15 16:07:54 +03:00
parent 4dd882f276
commit 3425ef77f7
2 changed files with 9 additions and 6 deletions
+2 -2
View File
@@ -698,8 +698,8 @@ function subscription_include_urltest_groups(section, value) {
function subscription_hide_urltest_group_outbounds(section, value) {
let child = child_item_by_value(section, "subscription_url", "url", value);
if (child != null)
return child_bool(child, "hide_urltest_group_outbounds", false);
return item_bool(section, "subscription_url_settings", value, "hide_urltest_group_outbounds", false);
return child_bool(child, "hide_urltest_group_outbounds", true);
return item_bool(section, "subscription_url_settings", value, "hide_urltest_group_outbounds", true);
}
function subscription_hide_detour_outbounds(section, value) {
+7 -4
View File
@@ -565,8 +565,11 @@ function contains(values, needle) {
}
if (!imported || imported.url != "https://native.example/ping" || imported.interval != "1m" || imported.tolerance != 80)
die("generated native URLTest did not preserve subscription params\n");
if (!selector || !contains(selector.outbounds, "Native A"))
die("native URLTest child must be selectable in selector\n");
if (!builtin || length(builtin.outbounds || []) != 1 || builtin.outbounds[0] != "Native A")
die("built-in URLTest regex filter should expand Native Group to Native A only\n");
for (let tag in selector.outbounds || [])
if (tag == "Native A")
die("native URLTest child must not be visible in selector by default\n");
for (let tag in selector.outbounds || [])
if (tag == "Detour Only")
die("detour-only outbound must not be visible in selector\n");
@@ -574,8 +577,8 @@ if (!reveal_urltest_selector || !contains(reveal_urltest_selector.outbounds, "Na
die("native URLTest child should be visible when URLTest hiding is disabled\n");
if (contains(reveal_urltest_selector ? reveal_urltest_selector.outbounds : [], "Detour Only"))
die("detour outbound should stay hidden when only URLTest hiding is disabled\n");
if (!reveal_detour_selector || !contains(reveal_detour_selector.outbounds, "Native A"))
die("native URLTest child should be selectable in selector\n");
if (contains(reveal_detour_selector ? reveal_detour_selector.outbounds : [], "Native A"))
die("native URLTest child should stay hidden when only detour hiding is disabled\n");
if (!reveal_detour_selector || !contains(reveal_detour_selector.outbounds, "Detour Only"))
die("detour outbound should be visible when detour hiding is disabled\n");
if (length(object_or_empty(cache.urltestGroups)["Native Group"].outbounds || []) != 1)