luci-app-pbr-1.2.2: preserve resolver_set selection on save - #38
Merged
Conversation
egc112
force-pushed
the
egc-luci-rmempty-1.2.2
branch
from
August 12, 2026 08:49
73e915e to
0822762
Compare
Backport of the resolver_set part of the 1.2.3 fix (mossdef-org#35) to the 1.2.2 branch. REQUIRES luci-base commit 974b5864e05ef30f38149389f15583c08bdd4eda ("luci-base: form: do not write values equal to the default"), which changed CBIAbstractValue.parse() in modules/luci-base/htdocs/luci-static/resources/form.js to: if (fval == null || fval == '' || (fval == this.default && (this.optional || this.rmempty))) { ... remove() ... } else if (this.forcewrite || !isEqual(cval, fval)) { ... write() ... } An option whose form value equals its declared o.default is now REMOVED from UCI rather than written, whenever optional or rmempty is true. rmempty defaults to true, so this silently applies to nearly every option that does not explicitly opt out. resolver_set is affected: pbr's backend treats an absent resolver_set as disabled (files/etc/init.d/pbr unsets it when empty or 'none'), while LuCI declares a default of adguardhome.ipset / dnsmasq.ipset / dnsmasq.nftset depending on detected support. pbr ships resolver_set 'dnsmasq.nftset' in files/etc/config/pbr, so after 974b5864 the first Save of the overview page DELETES that provisioned value and resolver set handling is silently disabled: the UI keeps showing resolver set support enabled while pbr runs with it off and domain policies fall back to one-time resolveip lookups. Unlike 1.2.3, the 1.2.2 files/etc/uci-defaults/90-pbr does not re-set resolver_set (it only renames the old resolver_ipset option), so nothing restores the value on a later package upgrade -- once deleted it stays deleted. o.rmempty = false is the fix; cfgvalue() returns null for an absent option, so it forces the write. An explicit o.default = 'none' base is set as well: it is inert while rmempty and optional are both false, but it documents the fallback on devices without any resolver set support. Not backported from the 1.2.3 change: the uplink_interface and uplink_interface6 adjustments, because those options do not exist in the 1.2.2 overview, and the forcewrite removal, because 1.2.2 does not use forcewrite anywhere. Safe on older luci-base without 974b5864: resolver_set is a ListValue with no blank choice, so rmempty = false is never reached. No config churn on up- or downgrade. Thanks to @pesa1234 for spotting this and for the equivalent fix in the openwrt/luci tree, PR #8927 ("luci-app-pbr: preserve resolver_set selection"): openwrt/luci#8927 (comment) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 14, 2026
egc112
added a commit
that referenced
this pull request
Aug 14, 2026
Lockstep release bump with pbr. Covers the resolver_set preservation fix (#38) plus the release workflow and packaging fixes. Compat is unchanged at 27 — nothing since release 20 touched the message catalog. Signed-off-by: Erik Conijn <egc112@msn.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of the resolver_set part of the 1.2.3 fix (#35) to the 1.2.2 branch.
REQUIRES luci-base commit 974b5864e05ef30f38149389f15583c08bdd4eda ("luci-base: form: do not write values equal to the default"), which changed CBIAbstractValue.parse() in
modules/luci-base/htdocs/luci-static/resources/form.js to:
An option whose form value equals its declared o.default is now REMOVED from UCI rather than written, whenever optional or rmempty is true. rmempty defaults to true, so this silently applies to nearly every option that does not explicitly opt out.
resolver_set is affected: pbr's backend treats an absent resolver_set as disabled (files/etc/init.d/pbr unsets it when empty or 'none'), while LuCI declares a default of adguardhome.ipset / dnsmasq.ipset / dnsmasq.nftset depending on detected support. pbr ships resolver_set 'dnsmasq.nftset' in files/etc/config/pbr, so after 974b5864 the first Save of the overview page DELETES that provisioned value and resolver set handling is silently disabled: the UI keeps showing resolver set support enabled while pbr runs with it off and domain policies fall back to one-time resolveip lookups.
Unlike 1.2.3, the 1.2.2 files/etc/uci-defaults/90-pbr does not re-set resolver_set (it only renames the old resolver_ipset option), so nothing restores the value on a later package upgrade -- once deleted it stays deleted.
o.rmempty = false is the fix; cfgvalue() returns null for an absent option, so it forces the write. An explicit o.default = 'none' base is set as well: it is inert while rmempty and optional are both false, but it documents the fallback on devices without any resolver set support.
Not backported from the 1.2.3 change: the uplink_interface and uplink_interface6 adjustments, because those options do not exist in the 1.2.2 overview, and the forcewrite removal, because 1.2.2 does not use forcewrite anywhere.
Safe on older luci-base without 974b5864: resolver_set is a ListValue with no blank choice, so rmempty = false is never reached. No config churn on up- or downgrade.
Thanks to @pesa1234 for spotting this and for the equivalent fix in the openwrt/luci tree, PR #8927 ("luci-app-pbr: preserve resolver_set selection"):
openwrt/luci#8927 (comment)