mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Add comment, undo changes to redaction logic when getting events
This commit is contained in:
parent
61c67722b3
commit
422ce4f30e
|
|
@ -564,7 +564,7 @@ func (d *EventDatabase) events(
|
||||||
Event: event,
|
Event: event,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if redactionsArePermanent {
|
if !redactionsArePermanent {
|
||||||
d.applyRedactions(results)
|
d.applyRedactions(results)
|
||||||
}
|
}
|
||||||
return results, nil
|
return results, nil
|
||||||
|
|
@ -601,7 +601,7 @@ func (d *EventDatabase) events(
|
||||||
Event: event,
|
Event: event,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if redactionsArePermanent {
|
if !redactionsArePermanent {
|
||||||
d.applyRedactions(results)
|
d.applyRedactions(results)
|
||||||
}
|
}
|
||||||
return results, nil
|
return results, nil
|
||||||
|
|
@ -1022,6 +1022,8 @@ func (d *EventDatabase) MaybeRedactEvent(
|
||||||
return fmt.Errorf("d.RedactionsTable.MarkRedactionValidated: %w", err)
|
return fmt.Errorf("d.RedactionsTable.MarkRedactionValidated: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We remove the entry from the cache, as if we just "StoreRoomServerEvent", we can't be
|
||||||
|
// certain that the cached entry actually is updated, since ristretto is eventual-persistent.
|
||||||
d.Cache.InvalidateRoomServerEvent(redactedEvent.EventNID)
|
d.Cache.InvalidateRoomServerEvent(redactedEvent.EventNID)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue