@@ -1976,12 +1976,17 @@ async def is_event_next_to_backward_gap(self, event: EventBase) -> bool:
1976
1976
1977
1977
Args:
1978
1978
room_id: room where the event lives
1979
- event_id : event to check
1979
+ event : event to check (can't be an `outlier`)
1980
1980
1981
1981
Returns:
1982
1982
Boolean indicating whether it's an extremity
1983
1983
"""
1984
1984
1985
+ assert not event .internal_metadata .is_outlier (), (
1986
+ "is_event_next_to_backward_gap(...) can't be used with `outlier` events. "
1987
+ "This function relies on `event_backward_extremities` which won't be filled in for `outliers`."
1988
+ )
1989
+
1985
1990
def is_event_next_to_backward_gap_txn (txn : LoggingTransaction ) -> bool :
1986
1991
# If the event in question has any of its prev_events listed as a
1987
1992
# backward extremity, it's next to a gap.
@@ -2031,12 +2036,17 @@ async def is_event_next_to_forward_gap(self, event: EventBase) -> bool:
2031
2036
2032
2037
Args:
2033
2038
room_id: room where the event lives
2034
- event_id : event to check
2039
+ event : event to check (can't be an `outlier`)
2035
2040
2036
2041
Returns:
2037
2042
Boolean indicating whether it's an extremity
2038
2043
"""
2039
2044
2045
+ assert not event .internal_metadata .is_outlier (), (
2046
+ "is_event_next_to_forward_gap(...) can't be used with `outlier` events. "
2047
+ "This function relies on `event_edges` and `event_forward_extremities` which won't be filled in for `outliers`."
2048
+ )
2049
+
2040
2050
def is_event_next_to_gap_txn (txn : LoggingTransaction ) -> bool :
2041
2051
# If the event in question is a forward extremity, we will just
2042
2052
# consider any potential forward gap as not a gap since it's one of
0 commit comments