[PR #6229] [CLOSED] fix(node): stop stale expiry sync from undoing client extensions (#6228) #6190

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6229
Author: @mrchatam
Created: 8/16/2026
Status: ❌ Closed

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


📝 Commits (4)

  • 29b7439 fix(node): stop stale expiry sync from undoing client extensions (#6228)
  • bced4d3 fix(node): also protect settings and client records after extend
  • 2341f21 fix(node): address #6228 review on fingerprint, quota, and SQL lockstep
  • 4e26060 fix(node): stamp pre-lift wire FP and dirty node after lifecycle lift

📊 Changes

4 files changed (+505 additions, -25 deletions)

View changed files

📝 internal/database/dialect.go (+34 -2)
📝 internal/web/service/client_locks.go (+67 -0)
📝 internal/web/service/inbound_node.go (+92 -21)
📝 internal/web/service/node_client_expiry_sync_test.go (+312 -2)

📄 Description

Summary

  • After an expired client is extended on the master, a lagging node snapshot could overwrite client_traffics.expiry_time with the old deadline and one-way-merge enable=false, so the client was removed again with "due to expiration or traffic limit".
  • Reject older absolute expiries on node→master merge (still allow forward renewals), ignore stale disables that carry a pre-extension deadline, and lift the same rules into adopted inbound settings / SyncInbound so client records and settings JSON stay consistent.
  • Strengthens regression coverage for traffics, clients, and inbound settings; keeps same-expiry quota disables latching (#4917).

Fixes #6228

Test plan

  • go test ./internal/web/service/ -run 'TestMergeActivationExpiry|TestStaleNodeDisable|TestNodeFirstConnect|TestNodeRenew|TestNodeStaleExpiry|TestNodeQuotaDisable|TestNodeActivation'
  • Broader TestNode* / TestBulkAdjust_Reenables* / global-traffic related suite
  • Multi-node manual: expire client → extend on master → confirm affected node keeps working without detach/reattach
  • Confirm quota disable with same expiry still disables (#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/6229 **Author:** [@mrchatam](https://github.com/mrchatam) **Created:** 8/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/6228-stale-node-expiry-after-extend` --- ### 📝 Commits (4) - [`29b7439`](https://github.com/MHSanaei/3x-ui/commit/29b7439c5eccbd79080812a25baa6bd62f7870cf) fix(node): stop stale expiry sync from undoing client extensions (#6228) - [`bced4d3`](https://github.com/MHSanaei/3x-ui/commit/bced4d31b82c7dbd7ffd5e04c6bbcb4b48efce99) fix(node): also protect settings and client records after extend - [`2341f21`](https://github.com/MHSanaei/3x-ui/commit/2341f211f52e2fcb317a1a725c35ff0156bad5ae) fix(node): address #6228 review on fingerprint, quota, and SQL lockstep - [`4e26060`](https://github.com/MHSanaei/3x-ui/commit/4e26060821895cdd8d7e3c9eaa2d24680c817fff) fix(node): stamp pre-lift wire FP and dirty node after lifecycle lift ### 📊 Changes **4 files changed** (+505 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `internal/database/dialect.go` (+34 -2) 📝 `internal/web/service/client_locks.go` (+67 -0) 📝 `internal/web/service/inbound_node.go` (+92 -21) 📝 `internal/web/service/node_client_expiry_sync_test.go` (+312 -2) </details> ### 📄 Description ## Summary - After an expired client is extended on the master, a lagging node snapshot could overwrite `client_traffics.expiry_time` with the old deadline and one-way-merge `enable=false`, so the client was removed again with "due to expiration or traffic limit". - Reject older absolute expiries on node→master merge (still allow forward renewals), ignore stale disables that carry a pre-extension deadline, and lift the same rules into adopted inbound settings / SyncInbound so client records and settings JSON stay consistent. - Strengthens regression coverage for traffics, `clients`, and inbound settings; keeps same-expiry quota disables latching (#4917). Fixes #6228 ## Test plan - [x] `go test ./internal/web/service/ -run 'TestMergeActivationExpiry|TestStaleNodeDisable|TestNodeFirstConnect|TestNodeRenew|TestNodeStaleExpiry|TestNodeQuotaDisable|TestNodeActivation'` - [x] Broader `TestNode*` / `TestBulkAdjust_Reenables*` / global-traffic related suite - [ ] Multi-node manual: expire client → extend on master → confirm affected node keeps working without detach/reattach - [ ] Confirm quota disable with same expiry still disables (#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:06:59 +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#6190
No description provided.