mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Unset RoomServerEvent
, since we can't be sure that Set
actually updates the cached entry (#3002)
This should deflake UTs and be more correct in terms of getting `Events`. `Events` tries to fetch the event from the cache first and may get an unredacted event from it, while it should already be redacted.
This commit is contained in:
parent
baef523cb0
commit
70322699ab
2 changed files with 11 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue