[PR #6454] [MERGED] fix(clients): use EffectiveFlow in BulkAttach #6276

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6454
Author: @mrchatam
Created: 9/11/2026
Status: ✅ Merged
Merged: 9/12/2026
Merged by: @MHSanaei

Base: main ← Head: fix/bulkattach-effective-flow


📝 Commits (3)

  • 8375f37 fix(clients): use EffectiveFlow in BulkAttach
  • 5abff0a test(clients): cover BulkAttach Vision flow when clients.flow is zeroed
  • 9a7c74e fix(clients): only apply EffectiveFlow when present in BulkAttach

📊 Changes

2 files changed (+90 additions, -0 deletions)

View changed files

📝 internal/web/service/client_bulk.go (+14 -0)
📝 internal/web/service/client_flow_isolation_test.go (+76 -0)

📄 Description

Summary

Fixes #6432.

Attach already seeds the wire client from EffectiveFlow so a zeroed clients.flow column (after a non-flow inbound sync) does not drop Vision. BulkAttach still used rec.ToClient() as-is, and the inbound "attach existing" modal always posts to the bulk endpoint — so Vision was lost on that path.

Resolve flows with EffectiveFlowsByEmails once per bulk attach and set client.Flow before clientWithInboundFlow. Adds a regression test next to the existing Attach coverage.

Test plan

  • Client with Vision on one Reality inbound, then clients.flow zeroed: bulk-attach to another Reality inbound keeps xtls-rprx-vision
  • Same bulk attach to a WS/TLS inbound still stores empty flow
  • Clients with no Vision anywhere still attach with empty flow (unchanged by design)
  • go test ./internal/web/service/ -run 'TestBulkAttach_PreservesVisionFlowWhenCanonicalColumnZeroed|TestAttach_PreservesVisionFlowWhenCanonicalColumnZeroed'

🔄 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/6454 **Author:** [@mrchatam](https://github.com/mrchatam) **Created:** 9/11/2026 **Status:** ✅ Merged **Merged:** 9/12/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/bulkattach-effective-flow` --- ### 📝 Commits (3) - [`8375f37`](https://github.com/MHSanaei/3x-ui/commit/8375f37d92ce3b02b4166852306dfc22e8daf989) fix(clients): use EffectiveFlow in BulkAttach - [`5abff0a`](https://github.com/MHSanaei/3x-ui/commit/5abff0a8bc3dea8e8704aceeef4ccab283453cf2) test(clients): cover BulkAttach Vision flow when clients.flow is zeroed - [`9a7c74e`](https://github.com/MHSanaei/3x-ui/commit/9a7c74e69f059ad8c9ab9bedaed769e966274d15) fix(clients): only apply EffectiveFlow when present in BulkAttach ### 📊 Changes **2 files changed** (+90 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `internal/web/service/client_bulk.go` (+14 -0) 📝 `internal/web/service/client_flow_isolation_test.go` (+76 -0) </details> ### 📄 Description ## Summary Fixes #6432. `Attach` already seeds the wire client from `EffectiveFlow` so a zeroed `clients.flow` column (after a non-flow inbound sync) does not drop Vision. `BulkAttach` still used `rec.ToClient()` as-is, and the inbound "attach existing" modal always posts to the bulk endpoint — so Vision was lost on that path. Resolve flows with `EffectiveFlowsByEmails` once per bulk attach and set `client.Flow` before `clientWithInboundFlow`. Adds a regression test next to the existing Attach coverage. ## Test plan - [ ] Client with Vision on one Reality inbound, then `clients.flow` zeroed: bulk-attach to another Reality inbound keeps `xtls-rprx-vision` - [ ] Same bulk attach to a WS/TLS inbound still stores empty flow - [ ] Clients with no Vision anywhere still attach with empty flow (unchanged by design) - [ ] `go test ./internal/web/service/ -run 'TestBulkAttach_PreservesVisionFlowWhenCanonicalColumnZeroed|TestAttach_PreservesVisionFlowWhenCanonicalColumnZeroed'` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:37 +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#6276
No description provided.