Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: clear project policy cache (#6427)

Danny Xube61b1be053d
diff --git a/backend/store/principal.go b/backend/store/principal.go
index 58d9425dfd..bb246b2ec9 100644
--- a/backend/store/principal.go
+++ b/backend/store/principal.go
@@ -5,6 +5,7 @@ import (
"database/sql"
"fmt"
"strings"
+ "sync"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"
@@ -446,5 +447,9 @@ func (s *Store) UpdateUser(ctx context.Context, userID int, patch *UpdateUserMes
return nil, err
}
s.userIDCache.Store(user.ID, user)
+ if patch.Email != nil {
+ s.projectIDPolicyCache = sync.Map{}
+ s.projectPolicyCache = sync.Map{}
+ }
return user, nil
}