[PR #6462] [CLOSED] fix(node): skip selected-inbound delete when import is pending #6284

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6462
Author: @mrchatam
Created: 9/11/2026
Status: ❌ Closed

Base: main ← Head: fix/node-selected-inbound-import


📝 Commits (3)

  • c8818e9 fix(node): skip selected-inbound delete when import is pending
  • bbdc01f fix(node): harden selected-inbound import vs delete sweep
  • bcb49f7 test(node): marshal inbound_tags as JSON in DelInbound selected-mode test

📊 Changes

6 files changed (+183 additions, -12 deletions)

View changed files

📝 internal/web/service/inbound.go (+11 -0)
📝 internal/web/service/inbound_node.go (+91 -6)
📝 internal/web/service/inbound_node_reconcile_test.go (+30 -5)
📝 internal/web/service/node.go (+44 -0)
📝 internal/web/service/node_bulk_dispatch_test.go (+6 -1)
📝 internal/web/service/port_conflict_test.go (+1 -0)

📄 Description

Summary

Fixes #6329 — selecting an existing node inbound in Selected inbounds mode no longer deletes it from the node.

In ReconcileNode, the selected-mode delete sweep treated a tag present in Node.InboundTags but missing a central inbounds row as a master-side deletion. That state is also how a pending import looks right after the operator selects a node-created inbound (reconcile runs before the snapshot merge that would adopt it).

Change

  • DelInbound records a short-lived per-node tag tombstone when a node-attached inbound is removed centrally.
  • Selected-mode sweep only deletes a managed remote tag when that tombstone is present; otherwise it leaves the tag for snapshot import.
  • Regression: TestReconcileNode_SelectedModeSkipsPendingImport; existing selected-mode delete tests now set a tombstone.

Test plan

  • go test ./internal/web/service/ -run TestReconcileNode_
  • Manual: create inbound on node → select it in central panel Selected mode → confirm it remains on the node and appears centrally after traffic sync
  • Manual: delete a selected node inbound from central while node is down → when node returns, confirm remote inbound is swept

🔄 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/6462 **Author:** [@mrchatam](https://github.com/mrchatam) **Created:** 9/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/node-selected-inbound-import` --- ### 📝 Commits (3) - [`c8818e9`](https://github.com/MHSanaei/3x-ui/commit/c8818e90e246b3f0dafaa71e6646f88325bb0726) fix(node): skip selected-inbound delete when import is pending - [`bbdc01f`](https://github.com/MHSanaei/3x-ui/commit/bbdc01f0923c7141b434fc4f575965e835559f85) fix(node): harden selected-inbound import vs delete sweep - [`bcb49f7`](https://github.com/MHSanaei/3x-ui/commit/bcb49f71720cfc3301b988154ebacc9bff98295f) test(node): marshal inbound_tags as JSON in DelInbound selected-mode test ### 📊 Changes **6 files changed** (+183 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `internal/web/service/inbound.go` (+11 -0) 📝 `internal/web/service/inbound_node.go` (+91 -6) 📝 `internal/web/service/inbound_node_reconcile_test.go` (+30 -5) 📝 `internal/web/service/node.go` (+44 -0) 📝 `internal/web/service/node_bulk_dispatch_test.go` (+6 -1) 📝 `internal/web/service/port_conflict_test.go` (+1 -0) </details> ### 📄 Description ## Summary Fixes #6329 — selecting an existing node inbound in **Selected inbounds** mode no longer deletes it from the node. In `ReconcileNode`, the selected-mode delete sweep treated a tag present in `Node.InboundTags` but missing a central `inbounds` row as a master-side deletion. That state is also how a *pending import* looks right after the operator selects a node-created inbound (reconcile runs before the snapshot merge that would adopt it). ## Change - `DelInbound` records a short-lived per-node tag tombstone when a node-attached inbound is removed centrally. - Selected-mode sweep only deletes a managed remote tag when that tombstone is present; otherwise it leaves the tag for snapshot import. - Regression: `TestReconcileNode_SelectedModeSkipsPendingImport`; existing selected-mode delete tests now set a tombstone. ## Test plan - [x] `go test ./internal/web/service/ -run TestReconcileNode_ ` - [ ] Manual: create inbound on node → select it in central panel Selected mode → confirm it remains on the node and appears centrally after traffic sync - [ ] Manual: delete a selected node inbound from central while node is down → when node returns, confirm remote inbound is swept --- <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:40 +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#6284
No description provided.