mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-20 10:00:58 +00:00
fix(node): keep disabled inbounds the node snapshot cannot report (#6221)
* fix(node): keep disabled inbounds the node snapshot cannot report A node builds its traffic snapshot from the inbounds Xray is actually running, so an inbound with enable=false is never in it. The central sweep reads that absence as "the node no longer has this inbound" and deletes the row, its clients' traffic history and its port reservation — on a perfectly healthy node, with no way to tell it apart from a real deletion. Disabling an inbound in the panel and waiting one sync interval is enough to lose it. Skip disabled inbounds in the sweep: their absence carries no information, and an explicit delete still removes them. * chore: drop the accidentally committed dist build stub internal/web/dist/.gitkeep is what make dist-stub creates locally. Committing it changes fresh-clone behaviour for everyone: today a bare go build fails loudly on //go:embed all:dist, which is the documented signal to run the stub target; with the file present the build succeeds and the panel serves an empty dist instead.
This commit is contained in:
@@ -714,6 +714,12 @@ func (s *InboundService) setRemoteTrafficLocked(nodeID int, snap *runtime.Traffi
|
||||
if dirty {
|
||||
continue
|
||||
}
|
||||
// Disabled inbounds are intentionally absent from the node's runtime
|
||||
// snapshot. Their absence is not evidence of deletion; retain the row,
|
||||
// client history and port reservation until an explicit delete occurs.
|
||||
if !c.Enable {
|
||||
continue
|
||||
}
|
||||
if len(snapTags) == 0 {
|
||||
// A node mid-restart or with a transient DB error can return an empty
|
||||
// inbound list with success=true. Treat "zero inbounds reported" as
|
||||
|
||||
Reference in New Issue
Block a user