Add an early return when handling no-op presence updates. (#14855)

This stops us from incrementing the presence stream position for no-op updates.
This commit is contained in:
Erik Johnston 2023-01-16 14:20:12 +00:00 committed by GitHub
parent a302d3ecf7
commit 4db3331bb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

1
changelog.d/14855.misc Normal file
View File

@ -0,0 +1 @@
Add an early return when handling no-op presence updates.

View File

@ -2155,6 +2155,11 @@ class PresenceFederationQueue:
# 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,