mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Unset RoomServerEvent, since we can't be sure that Set actually updates
the cached entry
This commit is contained in:
parent
baef523cb0
commit
d95b0cd1ae
|
|
@ -10,6 +10,7 @@ import (
|
|||
type RoomServerEventsCache interface {
|
||||
GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool)
|
||||
StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event)
|
||||
InvalidateRoomServerEvent(eventNID types.EventNID)
|
||||
}
|
||||
|
||||
func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) {
|
||||
|
|
@ -19,3 +20,7 @@ func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.
|
|||
func (c Caches) StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) {
|
||||
c.RoomServerEvents.Set(int64(eventNID), event)
|
||||
}
|
||||
|
||||
func (c Caches) InvalidateRoomServerEvent(eventNID types.EventNID) {
|
||||
c.RoomServerEvents.Unset(int64(eventNID))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1020,7 +1020,7 @@ func (d *EventDatabase) MaybeRedactEvent(
|
|||
return fmt.Errorf("d.RedactionsTable.MarkRedactionValidated: %w", err)
|
||||
}
|
||||
|
||||
d.Cache.StoreRoomServerEvent(redactedEvent.EventNID, redactedEvent.Event)
|
||||
d.Cache.InvalidateRoomServerEvent(redactedEvent.EventNID)
|
||||
|
||||
return nil
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue