mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6220] [CLOSED] fix: allow clients to share subscription IDs #6182
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#6182
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/6220
Author: @mvanhorn
Created: 8/15/2026
Status: ❌ Closed
Base:
main← Head:fix/6065-allow-shared-subids📝 Commits (1)
cdd8131fix: allow clients to share subscription IDs📊 Changes
5 files changed (+204 additions, -71 deletions)
View changed files
📝
internal/web/service/client_bulk.go(+0 -26)📝
internal/web/service/client_crud.go(+0 -24)📝
internal/web/service/client_portable.go(+0 -12)➕
internal/web/service/client_shared_subid_test.go(+174 -0)📝
internal/web/service/client_update_rename_test.go(+30 -9)📄 Description
Summary
Remove only the cross-client subId collision queries and bulk bookkeeping from the three service files, retaining subId format validation, generated values for omitted subIds, email uniqueness, and the existing same-email identity checks. Replace the Update regression that expects rejection with a positive assertion that two distinct-email records retain the shared subId and that the edited inbound settings are updated. Add focused service tests covering shared-subId creation against an existing record, two same-batch BulkCreate entries, and orphan import against an existing record, while continuing to assert that both clients remain distinct by email.
Since commit
88a36773, the client service rejects a subId already held by a different email in Create, Update, BulkCreate, and the orphan branch of ImportClients. That restriction prevents distinct clients reconciled from different nodes from being aggregated behind one subscription URL, even though the subscription queries and SyncInbound path already support multiple client records per subId. Email remains the actual unique client identity and database constraint; subId is a non-unique indexed lookup key. Currentmainstill contains the guards, so the reported behavior remains reproducible.Closes #6065
Why
Remove only the cross-client subId collision queries and bulk bookkeeping from the three service files, retaining subId format validation, generated values for omitted subIds, email uniqueness, and the existing same-email identity checks. Replace the Update regression that expects rejection with a positive assertion that two distinct-email records retain the shared subId and that the edited inbound settings are updated. Add focused service tests covering shared-subId creation against an existing record, two same-batch BulkCreate entries, and orphan import against an existing record, while continuing to assert that both clients remain distinct by email.
Type of change
Areas affected
How was this tested?
Not applicable to this change.
Screenshots / recordings
No user-visible surface changes in this PR, so there is nothing to show.
Breaking changes
None. This change is additive and does not alter an existing public interface or stored format.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.AI disclosure
AI was used for assistance.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.