From cdac2d3405aec90bf1efc31756dc92567f6772d5 Mon Sep 17 00:00:00 2001 From: Lalit Deore Date: Fri, 10 Apr 2026 17:08:13 +0530 Subject: [PATCH 1/2] skip adding support users to other orgs --- db-connector.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/db-connector.go b/db-connector.go index 3f96e5d0..397792ac 100755 --- a/db-connector.go +++ b/db-connector.go @@ -6818,7 +6818,7 @@ func fixUserOrg(ctx context.Context, user *User) *User { } } - if !found { + if !found && !user.SupportAccess { user.Orgs = append(user.Orgs, user.ActiveOrg.Id) } @@ -6856,8 +6856,11 @@ func fixUserOrg(ctx context.Context, user *User) *User { if userFound { org.Users[orgIndex] = innerUser - } else { + } else if !user.SupportAccess { org.Users = append(org.Users, innerUser) + } else { + log.Printf("[DEBUG] Skipping org.Users update for support user %s (%s) in org %s — not an official member", user.Username, user.Id, orgId) + return } err = SetOrg(ctx, *org, org.Id) From 925d152687baf9d6fdeeb33ae6df651b4a9335a5 Mon Sep 17 00:00:00 2001 From: Lalit Deore Date: Fri, 10 Apr 2026 17:08:13 +0530 Subject: [PATCH 2/2] remove workflow from frontend when deleted --- shared.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared.go b/shared.go index 1d25650b..4969a647 100644 --- a/shared.go +++ b/shared.go @@ -13049,7 +13049,6 @@ func HandleCreateSubOrg(resp http.ResponseWriter, request *http.Request) { Id: orgId, }) - DeleteCache(ctx, fmt.Sprintf("%s_childorgs", parentOrg.Id)) DeleteCache(ctx, fmt.Sprintf("Organizations_%s", parentOrg.Id)) err = SetOrg(ctx, *parentOrg, parentOrg.Id) @@ -13093,7 +13092,6 @@ func HandleCreateSubOrg(resp http.ResponseWriter, request *http.Request) { newOrg.Users = append(newOrg.Users, loopUser) } - DeleteCache(ctx, fmt.Sprintf("%s_childorgs", newOrg.Id)) err = SetOrg(ctx, newOrg, newOrg.Id) if err != nil { log.Printf("[WARNING] Failed setting new org %s: %s", newOrg.Id, err) @@ -32659,7 +32657,7 @@ func HandleDeleteOrg(resp http.ResponseWriter, request *http.Request) { parentOrg.ChildOrgs = newChildOrg - suborgCacheKey := fmt.Sprintf("%s_childorgs", parentOrg.Id) + suborgCacheKey := fmt.Sprintf("%s__childorgs", parentOrg.Id) DeleteCache(ctx, suborgCacheKey) DeleteCache(ctx, fmt.Sprintf("Organizations_%s", subOrg.Id)) parentOrg.SyncUsage.MultiTenant.Counter = int64(len(newChildOrg)) + 1