mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6702] [MERGED] Fix fragment exports for older Xray clients #6419
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6419
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6702
Author: @artemk1337
Created: 10/1/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @MHSanaei
Base:
main← Head:artemk1337/fix-fragment-legacy-compat📝 Commits (3)
451bea6Fix fragment exports for older Xray clients0ad2885Merge branch 'main' into artemk1337/fix-fragment-legacy-compatb5e5aaffix(link): tolerate a finalmask without tcp in panel share links📊 Changes
6 files changed (+413 additions, -7 deletions)
View changed files
📝
frontend/src/lib/xray/inbound-link.ts(+28 -1)📝
frontend/src/test/inbound-link.test.ts(+125 -0)📝
internal/sub/host_sub_test.go(+94 -5)📝
internal/sub/json_service.go(+3 -0)📝
internal/sub/service.go(+66 -1)📝
internal/sub/service_test.go(+97 -0)📄 Description
Older Xray clients cannot parse a TCP Fragment mask exported with only
lengthsanddelays: xray-core v1.260327.0 reproducesinfra/conf: LengthMin can't be 0for the five-range example.Add missing legacy
lengthanddelayfields from the last array entries when exporting panel links, URI subscriptions, and JSON subscriptions after host/global mask merging. Preserve the complete arrays and explicit singular fields, and transform copies so stored settings and server Xray configuration remain unchanged. Empty arrays do not generate fallback values; other mask types are unchanged.For the reported example, exports retain all five ranges and additionally include
length: "25-30"anddelay: "10-30". Older cores use this single final range; they cannot reproduce the five per-segment ranges. Newer cores continue to prefer the arrays.Validation:
go test ./...,go vet ./..., golangci-lint v2.14.0 (0 issues), build, focused subscription race tests, and gofmt passed. Initial MTProto timeouts passed on rerun; the upstream baseline package also passed.The user reported this error in application 4.13.0. Its embedded Xray version is unknown and phone behavior has not been retested; the core incompatibility above is independently confirmed. No server deployment is included.
Original user-reported error (application 4.13.0):
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.