fix(clients): collapse repeated inbound ids before fanning a client out

Create, BulkCreate, Attach and BulkAttach built one marshalled copy of
the client per entry of the request's inboundIds and held all of them
until the fan-out returned, with repeated ids never collapsed. An id
costs two bytes of request body, so a large client named on the same
inbound a few thousand times needed gigabytes and the panel died.

Every fan-out entry point now collapses the id list first, keeping the
order of first occurrence so credentials are still minted on the first
inbound.
This commit is contained in:
MHSanaei
2026-11-01 08:44:16 +01:00
parent f8ceede46f
commit 0972ac31eb
4 changed files with 59 additions and 2 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ func (s *InboundService) AnyNodePending(inboundIds []int) bool {
return false
}
nodeSvc := NodeService{}
for _, id := range inboundIds {
for _, id := range uniqueInts(inboundIds) {
ib, err := s.GetInbound(id)
if err != nil || ib.NodeID == nil {
continue