3x-ui/internal/database/model
MHSanaei 200ea09157
fix(node): never sweep a node's inbounds before their first adoption
Adding a node imports nothing; its pre-existing inbounds only become
central rows on the first clean traffic-sync tick. But any save of the
node (switching sync mode, picking tags after "Load inbounds from
node") marks it config-dirty, and the next tick then ran ReconcileNode
before that first adoption: with zero central rows the delete sweep saw
every remote tag as undesired and destroyed the node's real inbounds -
in "all" mode all of them - disconnecting live clients with no
confirmation, and the master then reported "record not found".

Track the first completed clean sync in nodes.inbounds_adopted_at and
skip the sweep (pushes still run) until it is set, so "absent locally"
can no longer be conflated with "deleted on the master". A node that
has synced before still sweeps normally, including the offline
last-inbound-deleted case. Existing nodes are seeded as adopted on
upgrade to keep their behavior unchanged.

Closes #5898
2026-07-11 22:48:57 +02:00
..
client_global_traffic.go fix: resolve a batch of open bug-tagged issues (traffic accounting, share strategy, sub address, CPU) (#5477) 2026-06-22 00:22:28 +02:00
host_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
model.go fix(node): never sweep a node's inbounds before their first adoption 2026-07-11 22:48:57 +02:00
model_mtproto_test.go refactor(mtproto): manage ad-tags per client only 2026-07-07 12:19:26 +02:00
model_test.go fix(inbound): strip XHTTP client-only fields from xray config, keep for subscriptions (#5349) 2026-06-15 16:35:43 +02:00
model_wireguard_peers_test.go fix(wireguard): build peers in GenXrayInboundConfig so node reconcile keeps clients (#5684) 2026-07-09 00:52:03 +02:00
model_wireguard_test.go feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00
node_client_ip.go feat(nodes): per-node client IP attribution for IP-limit 2026-06-15 23:50:05 +02:00
node_client_traffic.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00