[PR #6231] [MERGED] fix(node): stop stale expiry sync from undoing client extensions (#6228) #6192

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6231
Author: @mrchatam
Created: 8/17/2026
Status: ✅ Merged
Merged: 8/23/2026
Merged by: @MHSanaei

Base: main ← Head: fix/6228-stale-node-expiry-after-extend


📝 Commits (9)

  • 54ca870 fix(node): stop stale expiry sync from undoing client extensions (#6228)
  • 983a932 fix(node): lockstep client_traffics expiry/enable SQL with review fixes (#6228)
  • a9198b7 fix(node): add settings absolute helper for renew/lift guards (#6228)
  • d37ab1d fix(node): authority-aware lifecycle merge for multi-node sync (#6228)
  • d6e3d5c fix(node): clear config_dirty only after the post-reconcile traffic merge (#6228)
  • 95f0591 test(node): cover dirty-gate, master-absolute, and renew false-positives (#6228)
  • 8c37dfc Merge origin/main into fix/6228-stale-node-expiry-after-extend
  • c98aade Merge branch 'main' into fix/6228-stale-node-expiry-after-extend
  • 86aef62 fix(node): address the review findings on the lifecycle merge (#6228)

📊 Changes

14 files changed (+1193 additions, -83 deletions)

View changed files

📝 internal/database/dialect.go (+25 -2)
📝 internal/web/job/node_traffic_sync_job.go (+5 -1)
📝 internal/web/service/client_group_node_sync_test.go (+1 -1)
📝 internal/web/service/client_locks.go (+94 -0)
📝 internal/web/service/client_sync_orphan_test.go (+2 -2)
📝 internal/web/service/inbound_node.go (+202 -47)
📝 internal/web/service/inbound_node_sweep_log_test.go (+1 -1)
📝 internal/web/service/node_client_expiry_sync_test.go (+842 -8)
📝 internal/web/service/node_client_traffic_sum_test.go (+5 -5)
📝 internal/web/service/node_dirty_test.go (+2 -2)
📝 internal/web/service/node_host_adopt_test.go (+1 -1)
📝 internal/web/service/node_origin_guid_test.go (+8 -8)
📝 internal/web/service/node_sweep_guard_test.go (+3 -3)
📝 internal/web/service/node_tag_sync_test.go (+2 -2)

📄 Description

Summary

  • Fixes #6228: after a client expires then is extended on the master, a lagging node must not roll expiry_time backwards or latch enable=false and remove the user again.
  • Absolute expiry merge is forward-only; stale node disables are ignored when the master row is not already over quota; adopted settings get a lifecycle lift; reconcile fingerprints use the pre-lift node blob and the node is marked dirty so the next tick re-pushes.

Test plan

  • go test ./internal/web/service/ -run 'TestNodeStale|TestNodeQuota|TestClientTrafficMergeSQL|TestMergeActivation|TestStaleNodeDisable|TestNodeFirstConnect|TestNodeRenew|TestNodeActivation'
  • Multi-node: expire a client, extend on master, confirm a lagging node does not re-remove the user after sync
  • Quota-disabled client with matching expiry still latches enable=false (#4917)

Made with Cursor


🔄 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/6231 **Author:** [@mrchatam](https://github.com/mrchatam) **Created:** 8/17/2026 **Status:** ✅ Merged **Merged:** 8/23/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/6228-stale-node-expiry-after-extend` --- ### 📝 Commits (9) - [`54ca870`](https://github.com/MHSanaei/3x-ui/commit/54ca870f591c03598518a542237a88648ca94751) fix(node): stop stale expiry sync from undoing client extensions (#6228) - [`983a932`](https://github.com/MHSanaei/3x-ui/commit/983a932061d5e25a8ebba4858a02e7907b49b41c) fix(node): lockstep client_traffics expiry/enable SQL with review fixes (#6228) - [`a9198b7`](https://github.com/MHSanaei/3x-ui/commit/a9198b709b89c4089c30e8cec92ecd8cf29a6021) fix(node): add settings absolute helper for renew/lift guards (#6228) - [`d37ab1d`](https://github.com/MHSanaei/3x-ui/commit/d37ab1d90b1b2695a7fea5817e2ec4c929b8d565) fix(node): authority-aware lifecycle merge for multi-node sync (#6228) - [`d6e3d5c`](https://github.com/MHSanaei/3x-ui/commit/d6e3d5c268688b162a343b7fee9b115dd00031f7) fix(node): clear config_dirty only after the post-reconcile traffic merge (#6228) - [`95f0591`](https://github.com/MHSanaei/3x-ui/commit/95f0591ffa0c5439b4ba0b068e7d45fb5989097f) test(node): cover dirty-gate, master-absolute, and renew false-positives (#6228) - [`8c37dfc`](https://github.com/MHSanaei/3x-ui/commit/8c37dfc77e96ce044ed61180d361254e862fc09d) Merge origin/main into fix/6228-stale-node-expiry-after-extend - [`c98aade`](https://github.com/MHSanaei/3x-ui/commit/c98aadeeffb4c725523d72b603fe5ef01e96a365) Merge branch 'main' into fix/6228-stale-node-expiry-after-extend - [`86aef62`](https://github.com/MHSanaei/3x-ui/commit/86aef6245a0bfbd4dcf0320b0b4a46d0e5b66462) fix(node): address the review findings on the lifecycle merge (#6228) ### 📊 Changes **14 files changed** (+1193 additions, -83 deletions) <details> <summary>View changed files</summary> 📝 `internal/database/dialect.go` (+25 -2) 📝 `internal/web/job/node_traffic_sync_job.go` (+5 -1) 📝 `internal/web/service/client_group_node_sync_test.go` (+1 -1) 📝 `internal/web/service/client_locks.go` (+94 -0) 📝 `internal/web/service/client_sync_orphan_test.go` (+2 -2) 📝 `internal/web/service/inbound_node.go` (+202 -47) 📝 `internal/web/service/inbound_node_sweep_log_test.go` (+1 -1) 📝 `internal/web/service/node_client_expiry_sync_test.go` (+842 -8) 📝 `internal/web/service/node_client_traffic_sum_test.go` (+5 -5) 📝 `internal/web/service/node_dirty_test.go` (+2 -2) 📝 `internal/web/service/node_host_adopt_test.go` (+1 -1) 📝 `internal/web/service/node_origin_guid_test.go` (+8 -8) 📝 `internal/web/service/node_sweep_guard_test.go` (+3 -3) 📝 `internal/web/service/node_tag_sync_test.go` (+2 -2) </details> ### 📄 Description ## Summary - Fixes #6228: after a client expires then is extended on the master, a lagging node must not roll `expiry_time` backwards or latch `enable=false` and remove the user again. - Absolute expiry merge is forward-only; stale node disables are ignored when the master row is not already over quota; adopted settings get a lifecycle lift; reconcile fingerprints use the pre-lift node blob and the node is marked dirty so the next tick re-pushes. ## Test plan - [ ] `go test ./internal/web/service/ -run 'TestNodeStale|TestNodeQuota|TestClientTrafficMergeSQL|TestMergeActivation|TestStaleNodeDisable|TestNodeFirstConnect|TestNodeRenew|TestNodeActivation'` - [ ] Multi-node: expire a client, extend on master, confirm a lagging node does not re-remove the user after sync - [ ] Quota-disabled client with matching expiry still latches `enable=false` (#4917) Made with [Cursor](https://cursor.com) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:01 +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#6192
No description provided.