Revert "Unset RoomServerEvent, since we can't be sure that Set actually updates"

This reverts commit baa11e3dd1.
This commit is contained in:
Till Faelligen 2023-03-08 11:05:31 +01:00
parent baa11e3dd1
commit b3643905ad
No known key found for this signature in database
GPG key ID: ACCDC9606D472758
2 changed files with 1 additions and 6 deletions

View file

@ -10,7 +10,6 @@ import (
type RoomServerEventsCache interface { type RoomServerEventsCache interface {
GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool)
StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event)
InvalidateRoomServerEvent(eventNID types.EventNID)
} }
func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) { func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) {
@ -20,7 +19,3 @@ func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.
func (c Caches) StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) { func (c Caches) StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) {
c.RoomServerEvents.Set(int64(eventNID), event) c.RoomServerEvents.Set(int64(eventNID), event)
} }
func (c Caches) InvalidateRoomServerEvent(eventNID types.EventNID) {
c.RoomServerEvents.Unset(int64(eventNID))
}

View file

@ -1020,7 +1020,7 @@ func (d *EventDatabase) MaybeRedactEvent(
return fmt.Errorf("d.RedactionsTable.MarkRedactionValidated: %w", err) return fmt.Errorf("d.RedactionsTable.MarkRedactionValidated: %w", err)
} }
d.Cache.InvalidateRoomServerEvent(redactedEvent.EventNID) d.Cache.StoreRoomServerEvent(redactedEvent.EventNID, redactedEvent.Event)
return nil return nil
}) })