mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-15 12:03:04 +00:00
fix: undo scan for current sequence in get by id (#1956)
* index on events for changes * check for current sequence before filter events * fix(migration): enable hash shared indexes feature * fix(database): drop changes idx as it slows unwanted queries * fix: remove check for current sequence after objects loaded as not all events are processed
This commit is contained in:
@@ -34,13 +34,7 @@ func (repo *FeaturesRepo) GetDefaultFeatures(ctx context.Context) (*features_mod
|
||||
features = new(model.FeaturesView)
|
||||
}
|
||||
|
||||
sequence := features.Sequence
|
||||
currentSequence, err := repo.View.GetLatestFeaturesSequence()
|
||||
if err == nil {
|
||||
sequence = currentSequence.CurrentSequence
|
||||
}
|
||||
|
||||
events, esErr := repo.getIAMEvents(ctx, sequence)
|
||||
events, esErr := repo.getIAMEvents(ctx, features.Sequence)
|
||||
if errors.IsNotFound(viewErr) && len(events) == 0 {
|
||||
return nil, errors.ThrowNotFound(nil, "EVENT-Lsoj7", "Errors.Org.NotFound")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user