fix: query organization directly from event store (#10463)

Querying an organization by id allowed to trigger the org projection.
This could lead to performance impacts if the projection gets triggered
too often.

Instead of executing the trigger the organization by id query is now
always executed on the eventstore and reduces all event types required
of the organization requested.

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Silvan
2025-08-12 11:37:08 +02:00
committed by adlerhurst
parent 5a29e8909a
commit 1470ae08fc
16 changed files with 39 additions and 77 deletions

View File

@@ -57,12 +57,13 @@ type Features struct {
type ImprovedPerformanceType int32
const (
ImprovedPerformanceTypeUnspecified ImprovedPerformanceType = iota
ImprovedPerformanceTypeOrgByID
ImprovedPerformanceTypeProjectGrant
ImprovedPerformanceTypeProject
ImprovedPerformanceTypeUserGrant
ImprovedPerformanceTypeOrgDomainVerified
// Reserved: 1
ImprovedPerformanceTypeUnspecified ImprovedPerformanceType = 0
ImprovedPerformanceTypeProjectGrant ImprovedPerformanceType = 2
ImprovedPerformanceTypeProject ImprovedPerformanceType = 3
ImprovedPerformanceTypeUserGrant ImprovedPerformanceType = 4
ImprovedPerformanceTypeOrgDomainVerified ImprovedPerformanceType = 5
)
func (f Features) ShouldUseImprovedPerformance(typ ImprovedPerformanceType) bool {