[PR #7038] [MERGED] fix(sync): preserve shared client lifecycle across nodes #6591

Closed
opened 2026-11-02 04:09:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/7038
Author: @SeyedHashtag
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @MHSanaei

Base: main ← Head: codex/fix-node-client-lifecycle


📝 Commits (1)

  • 5b8d857 fix(sync): preserve shared client lifecycle across nodes

📊 Changes

4 files changed (+217 additions, -7 deletions)

View changed files

📝 internal/nodee2e/harness_test.go (+17 -0)
📝 internal/nodee2e/node_sync_test.go (+51 -0)
📝 internal/web/service/inbound_node.go (+14 -7)
➕ internal/web/service/node_shared_lifecycle_test.go (+135 -0)

📄 Description

Clients attached to multiple nodes share one traffic row, whose inbound may belong to a different node. Node synchronization currently consults a node-scoped map for lifecycle decisions, allowing a stale enabled/disabled state to overwrite the shared client record and adopted settings. It can also miss a renewal reported by a sibling node.

Use the existing batched global per-email traffic lookup for lifecycle merging, adopted settings, and client-record synchronization. Include clients reported only in settings, while retaining node-scoped maps for membership and cleanup.

Regression coverage uses disposable synthetic databases and loopback panels. It covers alternating node snapshots, preservation of master blocks, settings without traffic statistics, sibling-node renewals, and convergence across multiple synchronization cycles under both admin and node-sync tokens.

Validation:

  • make verify passed in Linux with Go 1.27.3 and Node 26, including all Go/frontend tests, lint, generated-file checks, builds, and docs schema consistency.
  • Node/shared-lifecycle/inbound-sync tests passed with the race detector.
  • The new real-panel regression fails on the unmodified upstream binary and passes with the fix under both admin and node-sync token scopes.

The full Windows gate encounters an existing public-IP test deadlock, reproduced on unmodified upstream; the Linux gate passes without exclusions.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/7038 **Author:** [@SeyedHashtag](https://github.com/SeyedHashtag) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `codex/fix-node-client-lifecycle` --- ### 📝 Commits (1) - [`5b8d857`](https://github.com/MHSanaei/3x-ui/commit/5b8d8573814e3e01e768a969c5e732e8a5248359) fix(sync): preserve shared client lifecycle across nodes ### 📊 Changes **4 files changed** (+217 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `internal/nodee2e/harness_test.go` (+17 -0) 📝 `internal/nodee2e/node_sync_test.go` (+51 -0) 📝 `internal/web/service/inbound_node.go` (+14 -7) ➕ `internal/web/service/node_shared_lifecycle_test.go` (+135 -0) </details> ### 📄 Description Clients attached to multiple nodes share one traffic row, whose inbound may belong to a different node. Node synchronization currently consults a node-scoped map for lifecycle decisions, allowing a stale enabled/disabled state to overwrite the shared client record and adopted settings. It can also miss a renewal reported by a sibling node. Use the existing batched global per-email traffic lookup for lifecycle merging, adopted settings, and client-record synchronization. Include clients reported only in settings, while retaining node-scoped maps for membership and cleanup. Regression coverage uses disposable synthetic databases and loopback panels. It covers alternating node snapshots, preservation of master blocks, settings without traffic statistics, sibling-node renewals, and convergence across multiple synchronization cycles under both admin and node-sync tokens. Validation: - `make verify` passed in Linux with Go 1.27.3 and Node 26, including all Go/frontend tests, lint, generated-file checks, builds, and docs schema consistency. - Node/shared-lifecycle/inbound-sync tests passed with the race detector. - The new real-panel regression fails on the unmodified upstream binary and passes with the fix under both admin and node-sync token scopes. The full Windows gate encounters an existing public-IP test deadlock, reproduced on unmodified upstream; the Linux gate passes without exclusions. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #7038] fix(sync): preserve shared client lifecycle across nodes to [PR #7038] [MERGED] fix(sync): preserve shared client lifecycle across nodes 2026-11-07 14:34:08 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6591
No description provided.