_run_push_actions_and_persist_event: handle no min_depth (#11014)

Make sure that we correctly handle rooms where we do not yet have a
`min_depth`, and also add some comments and logging.
This commit is contained in:
Richard van der Hoff 2021-10-18 18:17:15 +02:00 committed by GitHub
parent 7d70582eb0
commit e8f24b6c35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 11 deletions

View file

@ -906,7 +906,7 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas
desc="get_latest_event_ids_in_room",
)
async def get_min_depth(self, room_id: str) -> int:
async def get_min_depth(self, room_id: str) -> Optional[int]:
"""For the given room, get the minimum depth we have seen for it."""
return await self.db_pool.runInteraction(
"get_min_depth", self._get_min_depth_interaction, room_id