Skip to content

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

chore: write-through for empty etags (#13273)

Danny Xubd52a5496c4f
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index 2f170b12c4..41d384e8e5 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -410,7 +410,7 @@ func (s *ProjectService) SetIamPolicy(ctx context.Context, request *v1pb.SetIamP
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to find project iam policy with error: %v", err.Error())
}
- if request.Etag != policyMessage.Etag {
+ if request.Etag != "" && request.Etag != policyMessage.Etag {
return nil, status.Errorf(codes.Aborted, "there is concurrent update to the project iam policy, please refresh and try again.")
}
oldIamPolicyMsg = policyMessage
diff --git a/backend/api/v1/workspace_service.go b/backend/api/v1/workspace_service.go
index dfc72446ed..587d84d90c 100644
--- a/backend/api/v1/workspace_service.go
+++ b/backend/api/v1/workspace_service.go
@@ -44,7 +44,7 @@ func (s *WorkspaceService) SetIamPolicy(ctx context.Context, request *v1pb.SetIa
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to find workspace iam policy with error: %v", err.Error())
}
- if request.Etag != policyMessage.Etag {
+ if request.Etag != "" && request.Etag != policyMessage.Etag {
return nil, status.Errorf(codes.Aborted, "there is concurrent update to the workspace iam policy, please refresh and try again.")
}