mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-09 19:33:40 +00:00
fix(eventstore): set owner of previous events if present
This commit is contained in:
parent
b9e351ab84
commit
a6f86f1203
@ -124,7 +124,18 @@ func scanToSequence(rows *sql.Rows, sequences []*latestSequence) error {
|
||||
return nil
|
||||
}
|
||||
sequence.sequence = currentSequence
|
||||
if sequence.aggregate.ResourceOwner == "" {
|
||||
if resourceOwner != "" && sequence.aggregate.ResourceOwner != "" && sequence.aggregate.ResourceOwner != resourceOwner {
|
||||
logging.WithFields(
|
||||
"current_sequence", sequence.sequence,
|
||||
"instance_id", sequence.aggregate.InstanceID,
|
||||
"agg_type", sequence.aggregate.Type,
|
||||
"agg_id", sequence.aggregate.ID,
|
||||
"current_owner", resourceOwner,
|
||||
"provided_owner", sequence.aggregate.ResourceOwner,
|
||||
).Info("would have set wrong resource owner")
|
||||
}
|
||||
// set resource owner from previous events
|
||||
if resourceOwner != "" {
|
||||
sequence.aggregate.ResourceOwner = resourceOwner
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user