fix(traffic): keep enforcing limits when one inbound's settings are broken

Disabling depleted clients rewrote each affected inbound's settings and
aborted the whole lifecycle tick when one blob did not parse, so a node
storing a malformed blob on the master switched expiry and quota checks
off for every inbound. Unparseable node settings are now treated like a
snapshot that drops the hub's clients (the hub keeps its copy), and an
unparseable stored blob is left as it is while the client's rows are
still disabled; the rewrite also works one level deep like the others.
This commit is contained in:
MHSanaei
2026-10-31 10:43:40 +01:00
parent a203056949
commit f67111a08a
4 changed files with 85 additions and 18 deletions
+3 -1
View File
@@ -468,7 +468,9 @@ func adoptedWireInbound(c, snapIb *model.Inbound, adoptedSettings string) *model
// still links some: a reset or half-started node, never an authoritative removal.
func snapshotDropsEveryHubClient(tx *gorm.DB, inboundID int, wireSettings string) bool {
clients, err := ParseInboundSettingsClients(wireSettings)
if err != nil || len(clients) > 0 {
// Settings that do not parse list no client the hub could keep either; storing them
// would only hand every later reader of the row a blob it cannot use.
if err == nil && len(clients) > 0 {
return false
}
var links int64