mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-16 02:35:12 +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:
@@ -38,13 +38,7 @@ func (repo *OrgRepo) OrgByID(ctx context.Context, id string) (*org_model.OrgView
|
||||
org = new(model.OrgView)
|
||||
}
|
||||
|
||||
sequence := org.Sequence
|
||||
currentSequence, err := repo.View.GetLatestOrgSequence()
|
||||
if err == nil {
|
||||
sequence = currentSequence.CurrentSequence
|
||||
}
|
||||
|
||||
events, esErr := repo.getOrgEvents(ctx, id, sequence)
|
||||
events, esErr := repo.getOrgEvents(ctx, id, org.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