Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit bc9ca1f

Browse files
committed
Provide fake depth to builder of temp event for auth calculation
This prevents an unnecessary query to fetch the depth of the event which we never need to store.
1 parent e93619a commit bc9ca1f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

synapse/handlers/message.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,9 @@ async def create_new_client_event(
10451045
temp_event = await builder.build(
10461046
prev_event_ids=prev_event_ids,
10471047
auth_event_ids=state_event_ids,
1048-
depth=depth,
1048+
# Always provide depth here to avoid unncessary lookup from the events
1049+
# table; we've no need for the depth of this temp event to be correct.
1050+
depth=0,
10491051
)
10501052
state_events = await self.store.get_events_as_list(state_event_ids)
10511053
# Create a StateMap[str]

0 commit comments

Comments
 (0)