mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5488] [MERGED] fix(nodes): cloned-node attribution, node-hosted client display (online/speed/counts), and sync robustness #5898
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5898
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5488
Author: @MHSanaei
Created: 6/22/2026
Status: ✅ Merged
Merged: 6/22/2026
Merged by: @MHSanaei
Base:
main← Head:fix/cloned-node-duplicate-guid📝 Commits (10+)
af94179fix(nodes): keep cloned nodes (shared panelGuid) in separate attribution buckets98c9ba1fix(nodes): extend duplicate-GUID hardening to master collisions, IP attribution, and a heartbeat warning846b8b3fix(node-sync): log the client-IP-attribution 404 once per node, not every cycle7458ed4fix(nodes): remap a cloned node's own-panelGuid origin so the inbound page shows onlinee0ac65afix(node-sync): don't delete a node's central inbounds when its snapshot is empty5aa8777fix(email): stay silent when SMTP notifications are disabledf96e877fix(nodes): count only expired/exhausted as 'ended', not disabled clients2ce5891feat(nodes): show live speed for node-hosted inboundseedb65bfix(nodes): normalize node-inbound speed by elapsed time to avoid recovery spikes32e97cdfix(inbounds): keep last speed across page navigation instead of blanking📊 Changes
21 files changed (+891 additions, -146 deletions)
View changed files
📝
frontend/public/openapi.json(+12 -0)📝
frontend/src/generated/examples.ts(+2 -0)📝
frontend/src/generated/schemas.ts(+10 -0)📝
frontend/src/generated/types.ts(+2 -0)📝
frontend/src/generated/zod.ts(+2 -0)📝
frontend/src/pages/inbounds/list/InboundList.tsx(+6 -1)📝
frontend/src/pages/inbounds/list/useInboundColumns.tsx(+12 -12)📝
frontend/src/pages/inbounds/useInbounds.ts(+44 -16)📝
frontend/src/pages/nodes/NodeList.tsx(+30 -9)📝
frontend/src/schemas/node.ts(+2 -0)📝
internal/database/model/model.go(+2 -0)📝
internal/web/job/node_traffic_sync_job.go(+105 -7)📝
internal/web/service/email/subscriber.go(+3 -0)📝
internal/web/service/inbound_node.go(+60 -12)📝
internal/web/service/inbound_node_ips.go(+31 -7)📝
internal/web/service/inbound_node_ips_test.go(+2 -2)📝
internal/web/service/node.go(+180 -52)➕
internal/web/service/node_client_breakdown_test.go(+87 -0)📝
internal/web/service/node_origin_guid_test.go(+98 -0)➕
internal/web/service/node_shared_guid_test.go(+162 -0)...and 1 more files
📄 Description
Fixes a cluster of multi-node panel issues found while debugging a fleet whose nodes were cloned from one disk image (so they share a
panelGuid) and whose inbounds had been delete+recreated. Centered on node attribution, but also brings the Nodes page client display to parity with the Inbounds page and hardens the node sync.1. Cloned / duplicate-
panelGuidattribution (#4983 hardening)#4983keys online + inbound + IP attribution bypanelGuid, assuming it's globally unique. Cloned node servers ship an identicalpanelGuid, which collapsed several physical nodes into one bucket (online cross-attributed, counts merged).panelGuidas ambiguous when more than one direct node reports it, or it equals the master's ownpanelGuid, and fall back to a node-unique key. Applied consistently toorigin_node_guid, the online tree (+ self-key remap),effectiveNodeGuid, GUID-keyed IP attribution, and node deletion.sharedNodeGuids/ambiguousNodeGuidscompute the collision set.panelGuidorigin: these builds report their own inbounds' origin as their (shared)panelGuid, soorigin_node_guidstayed the shared value while online was keyed by the node-unique key — the inbound page then read an empty bucket and showed everyone offline. Now resolved through the same key.panelGuidalready used by another node or the master, so the operator knows to regenerate it.2. Node-hosted inbound display parity
trafficsdelta feed that only the local Xray poll produced. The node sync now diffs per-inbound cumulative totals and broadcastsnodeTraffics; the frontend appliestrafficsto local inbounds andnodeTrafficsto node inbounds within their own scope (no clobbering). Deltas are normalized by real elapsed time so a node recovering from an outage shows its average rate, not an impossible one-tick spike. Speed is also cached across page navigation so it no longer blanks for a poll on return.client_traffics.inbound_id— that column goes stale after an inbound is delete+recreated, so filtering by it dropped almost every row and undercounted (active showed ~5 instead of ~1100).3. Node-sync robustness & log noise
success=true, which previously wiped its central inbounds and all their clients (observed: a node showing 0 clients but still online).clientIpsByGuid404 once per node (re-armed on recovery) instead of every ~10s cycle.4. UI / layout
5. Unrelated small fix
Tests
Added coverage for the ambiguity disambiguation (node-vs-node and node-vs-master),
effectiveNodeKey, the per-node count split, the empty-snapshot guard, the cloned-node origin remap, and the email-based breakdown (proven against a deliberately staleinbound_id).go build,go vet, the fullservice/jobsuites, and the frontend typecheck pass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.