mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-06 15:12:14 +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:
@@ -42,13 +42,7 @@ func (repo *UserRepo) UserByID(ctx context.Context, id string) (*usr_model.UserV
|
||||
user = new(model.UserView)
|
||||
}
|
||||
|
||||
sequence := user.Sequence
|
||||
currentSequence, err := repo.View.GetLatestUserSequence()
|
||||
if err == nil {
|
||||
sequence = currentSequence.CurrentSequence
|
||||
}
|
||||
|
||||
events, esErr := repo.getUserEvents(ctx, id, sequence)
|
||||
events, esErr := repo.getUserEvents(ctx, id, user.Sequence)
|
||||
if caos_errs.IsNotFound(viewErr) && len(events) == 0 {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "EVENT-Lsoj7", "Errors.User.NotFound")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user