[PR #5006] [MERGED] fix(xray): sync routing rules when outbound tag is renamed #5754

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5006
Author: @nima1024m
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/8/2026
Merged by: @MHSanaei

Base: main ← Head: fix/outbound-rename-routing-sync


📝 Commits (8)

  • 343d4f9 chore: ignore local .cursor directory
  • 5d57965 fix(xray): sync routing rules when outbound tag is renamed
  • 8338607 Merge branch 'main' into fix/outbound-rename-routing-sync
  • dfbb76f test: mock HttpUtil to fix unhandled vitest rejections
  • c1638aa test(frontend): mock axios globally to prevent flaky network errors on CI
  • 95797d1 Merge pull request #2 from rqzbeh/fix/outbound-rename-routing-sync
  • ca6e045 test(frontend): fix eslint any errors in component test setup
  • d15c375 Merge pull request #3 from rqzbeh/fix/pr3

📊 Changes

6 files changed (+121 additions, -6 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 frontend/src/pages/xray/XrayPage.tsx (+3 -5)
📝 frontend/src/pages/xray/basics/helpers.ts (+33 -0)
📝 frontend/src/pages/xray/outbounds/OutboundsTab.tsx (+7 -1)
➕ frontend/src/test/outbound-tag-rename.test.ts (+61 -0)
📝 frontend/src/test/setup.components.ts (+16 -0)

📄 Description

Summary

  • Propagate outbound tag renames to routing rules, balancer selectors/fallbacks, and sockopt dialerProxy references
  • Fixes invalid routing rules after renaming an outbound (e.g. To-External-Proxy) in the Outbounds tab
  • Adds .cursor/ to .gitignore for local-only editor files

Why

Editing an outbound only updated the outbounds array. Routing rules store outboundTag as a plain string, so renaming left rules pointing at a tag that no longer exists. Balancer renames and WARP/Nord outbound resets already updated references; the regular Outbounds edit path did not.

Files affected

  • frontend/src/pages/xray/basics/helpers.ts — new propagateOutboundTagRename()
  • frontend/src/pages/xray/outbounds/OutboundsTab.tsx — call on outbound edit
  • frontend/src/pages/xray/XrayPage.tsx — reuse helper for WARP/Nord path
  • frontend/src/test/outbound-tag-rename.test.ts — unit tests
  • .gitignore — ignore .cursor/

Test plan

  • npx vitest run src/test/outbound-tag-rename.test.ts (4 passed)
  • npx tsc --noEmit
  • Manual: Xray → Outbounds → rename outbound used by a routing rule → Routing tab shows updated outboundTag → Save → verify config.json

Risks

  • Frontend-only change; no backend or migration impact
  • Also updates balancer selector/fallbackTag and dialerProxy when those reference the old tag

🔄 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/5006 **Author:** [@nima1024m](https://github.com/nima1024m) **Created:** 6/6/2026 **Status:** ✅ Merged **Merged:** 6/8/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/outbound-rename-routing-sync` --- ### 📝 Commits (8) - [`343d4f9`](https://github.com/MHSanaei/3x-ui/commit/343d4f9fc9570dd74e2fb5498f17525662ee8ce0) chore: ignore local .cursor directory - [`5d57965`](https://github.com/MHSanaei/3x-ui/commit/5d579658823e1a56210b5c36ba67816b9b3c668c) fix(xray): sync routing rules when outbound tag is renamed - [`8338607`](https://github.com/MHSanaei/3x-ui/commit/8338607fee8a1cd78d75dd06e2c2fc3f58ed701f) Merge branch 'main' into fix/outbound-rename-routing-sync - [`dfbb76f`](https://github.com/MHSanaei/3x-ui/commit/dfbb76fd9393446e7cf55e8b200938cb8a392374) test: mock HttpUtil to fix unhandled vitest rejections - [`c1638aa`](https://github.com/MHSanaei/3x-ui/commit/c1638aa0587afba4e64e2c676b38d4489d3207ee) test(frontend): mock axios globally to prevent flaky network errors on CI - [`95797d1`](https://github.com/MHSanaei/3x-ui/commit/95797d14cd760a11ee6245096a1853a7193d796e) Merge pull request #2 from rqzbeh/fix/outbound-rename-routing-sync - [`ca6e045`](https://github.com/MHSanaei/3x-ui/commit/ca6e045b080e69bdac041bf89290cf34911b535c) test(frontend): fix eslint any errors in component test setup - [`d15c375`](https://github.com/MHSanaei/3x-ui/commit/d15c3759dccaded776bd87fa782146208cc5b7b4) Merge pull request #3 from rqzbeh/fix/pr3 ### 📊 Changes **6 files changed** (+121 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `frontend/src/pages/xray/XrayPage.tsx` (+3 -5) 📝 `frontend/src/pages/xray/basics/helpers.ts` (+33 -0) 📝 `frontend/src/pages/xray/outbounds/OutboundsTab.tsx` (+7 -1) ➕ `frontend/src/test/outbound-tag-rename.test.ts` (+61 -0) 📝 `frontend/src/test/setup.components.ts` (+16 -0) </details> ### 📄 Description ## Summary - Propagate outbound tag renames to routing rules, balancer selectors/fallbacks, and sockopt dialerProxy references - Fixes invalid routing rules after renaming an outbound (e.g. To-External-Proxy) in the Outbounds tab - Adds .cursor/ to .gitignore for local-only editor files ## Why Editing an outbound only updated the outbounds array. Routing rules store outboundTag as a plain string, so renaming left rules pointing at a tag that no longer exists. Balancer renames and WARP/Nord outbound resets already updated references; the regular Outbounds edit path did not. ## Files affected - frontend/src/pages/xray/basics/helpers.ts — new propagateOutboundTagRename() - frontend/src/pages/xray/outbounds/OutboundsTab.tsx — call on outbound edit - frontend/src/pages/xray/XrayPage.tsx — reuse helper for WARP/Nord path - frontend/src/test/outbound-tag-rename.test.ts — unit tests - .gitignore — ignore .cursor/ ## Test plan - [x] npx vitest run src/test/outbound-tag-rename.test.ts (4 passed) - [x] npx tsc --noEmit - [ ] Manual: Xray → Outbounds → rename outbound used by a routing rule → Routing tab shows updated outboundTag → Save → verify config.json ## Risks - Frontend-only change; no backend or migration impact - Also updates balancer selector/fallbackTag and dialerProxy when those reference the old tag --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:50 +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#5754
No description provided.