mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-17 14:44:20 -05:00
Fix the return type of send_nonmember_events. (#8112)
This commit is contained in:
parent
5cf7c12995
commit
3c01724b33
1
changelog.d/8112.misc
Normal file
1
changelog.d/8112.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Return the previous stream token if a non-member event is a duplicate.
|
@ -674,7 +674,7 @@ class EventCreationHandler(object):
|
|||||||
event.event_id,
|
event.event_id,
|
||||||
prev_event.event_id,
|
prev_event.event_id,
|
||||||
)
|
)
|
||||||
return await self.store.get_stream_token_for_event(prev_event.event_id)
|
return await self.store.get_stream_id_for_event(prev_event.event_id)
|
||||||
|
|
||||||
return await self.handle_new_client_event(
|
return await self.handle_new_client_event(
|
||||||
requester=requester, event=event, context=context, ratelimit=ratelimit
|
requester=requester, event=event, context=context, ratelimit=ratelimit
|
||||||
|
@ -582,6 +582,19 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
|
|||||||
)
|
)
|
||||||
return "t%d-%d" % (topo, token)
|
return "t%d-%d" % (topo, token)
|
||||||
|
|
||||||
|
async def get_stream_id_for_event(self, event_id: str) -> int:
|
||||||
|
"""The stream ID for an event
|
||||||
|
Args:
|
||||||
|
event_id: The id of the event to look up a stream token for.
|
||||||
|
Raises:
|
||||||
|
StoreError if the event wasn't in the database.
|
||||||
|
Returns:
|
||||||
|
A stream ID.
|
||||||
|
"""
|
||||||
|
return await self.db_pool.simple_select_one_onecol(
|
||||||
|
table="events", keyvalues={"event_id": event_id}, retcol="stream_ordering"
|
||||||
|
)
|
||||||
|
|
||||||
async def get_stream_token_for_event(self, event_id: str) -> str:
|
async def get_stream_token_for_event(self, event_id: str) -> str:
|
||||||
"""The stream token for an event
|
"""The stream token for an event
|
||||||
Args:
|
Args:
|
||||||
@ -591,10 +604,8 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
|
|||||||
Returns:
|
Returns:
|
||||||
A "s%d" stream token.
|
A "s%d" stream token.
|
||||||
"""
|
"""
|
||||||
row = await self.db_pool.simple_select_one_onecol(
|
stream_id = await self.get_stream_id_for_event(event_id)
|
||||||
table="events", keyvalues={"event_id": event_id}, retcol="stream_ordering"
|
return "s%d" % (stream_id,)
|
||||||
)
|
|
||||||
return "s%d" % (row,)
|
|
||||||
|
|
||||||
async def get_topological_token_for_event(self, event_id: str) -> str:
|
async def get_topological_token_for_event(self, event_id: str) -> str:
|
||||||
"""The stream token for an event
|
"""The stream token for an event
|
||||||
|
Loading…
Reference in New Issue
Block a user