Skip to content

fix(xray): sync routing rules when outbound tag is renamed#5006

Open
nima1024m wants to merge 2 commits into
MHSanaei:mainfrom
nima1024m:fix/outbound-rename-routing-sync
Open

fix(xray): sync routing rules when outbound tag is renamed#5006
nima1024m wants to merge 2 commits into
MHSanaei:mainfrom
nima1024m:fix/outbound-rename-routing-sync

Conversation

@nima1024m
Copy link
Copy Markdown
Contributor

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

nima1024m added 2 commits June 6, 2026 14:11
Renaming an outbound in the Outbounds tab only updated the outbound list, leaving routing rules pointing at the old tag. Propagate tag changes to routing rules, balancer selectors, and sockopt dialerProxy references, matching the behavior already used for balancer and WARP/Nord renames.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant