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

Commit

Permalink
Add an early return when handling no-op presence updates. (#14855)
Browse files Browse the repository at this point in the history
This stops us from incrementing the presence stream position for no-op updates.
  • Loading branch information
erikjohnston authored Jan 16, 2023
1 parent a302d3e commit 4db3331
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/14855.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add an early return when handling no-op presence updates.
5 changes: 5 additions & 0 deletions synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,11 @@ def send_presence_to_destinations(
# This should only be called on a presence writer.
assert self._presence_writer

if not states or not destinations:
# Ignore calls which either don't have any new states or don't need
# to be sent anywhere.
return

if self._federation:
self._federation.send_presence_to_destinations(
states=states,
Expand Down

0 comments on commit 4db3331

Please sign in to comment.