mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6979] [CLOSED] fix(sub): restore TUIC links in subscription downloads #6560
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#6560
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/6979
Author: @HamedSanaei
Created: 10/27/2026
Status: ❌ Closed
Base:
main← Head:codex/fix-tuic-cached-subscriptions📝 Commits (1)
ded5910fix(sub): retain TUIC credentials in subscription bodies📊 Changes
2 files changed (+145 additions, -3 deletions)
View changed files
📝
internal/sub/service.go(+4 -3)➕
internal/sub/tuic_settings_cache_test.go(+141 -0)📄 Description
Summary
Restore TUIC links in raw subscription downloads by retaining TUIC's full inbound settings through the existing protocol-specific cache exception. This also preserves Clash's fallback for legacy TUIC credentials.
Why
The v3.11.0 subscription settings cache removes
settings.clients, but TUIC's link generator still needs that array for UUID/password lookup. Browser subscription pages bypass the cache and keep showing the working link, while application downloads omit it.TUIC accepts both the current
idand legacyuuidsettings keys. The existing settings parser/client synchronization can leave the normalized UUID empty for the legacy shape; Clash also relies on its existing settings fallback in that case. Keeping the complete TUIC settings, like WireGuard and AmneziaWG, restores both paths without changing credential precedence or URI generation. Other protocols continue using the shared cache.Closes #6978
Related: #6963 contains an overlapping production fix. This PR adds HTTP-route, plaintext/Base64, legacy-UUID, and subscriber-filtering regression coverage.
Type of change
Areas affected
The changed behavior concerns raw and Clash subscriptions; JSON protocol support is unchanged.
How was this tested?
Regression tests use a real temporary database, the existing client synchronization service, and the actual Gin subscription controller with its default settings cache enabled.
Before the fix, the browser page contains TUIC while both plaintext and Base64 application responses drop it; the legacy-UUID Clash regression also fails. After the fix, the tests check:
idand legacyuuidsettings, plaintext and Base64 responses.Validation:
go vet -p=2 ./...: passed.FuzzParseLinkandFuzzDecodeCertPin: passed, 30 seconds each.make verify: passed, including Go tests/build/lint, 2,018 frontend tests, typecheck, frontend/Storybook production builds, and generation checks.make race: passed across Go packages.Manual reproduction:
/sub/<id>as a standard subscription, with automatic JSON/Clash routing disabled. Decode Base64 if configured.tuic://entry remains present and has the same credentials/options as the browser page.Actual v2rayN/Shadowrocket applications and live TUIC connections were not exercised locally; the regression tests cover the server responses through their production routes.
Breaking changes
None. No route, API schema, database migration, UI, dependency, or link-format changes. TUIC uses the existing full-settings read path on each subscription request; the shared client-less cache remains enabled for the other eligible protocols.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass. No frontend changes; these checks still ran.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #6979] fix(sub): restore TUIC links in subscription downloadsto [PR #6979] [CLOSED] fix(sub): restore TUIC links in subscription downloads