Skip to content

Commit 198486c

Browse files
erikjohnstonphil-flex
authored andcommitted
Always return a deferred from get_current_state_deltas. (matrix-org#7019)
This currently causes presence notify code to log exceptions when there is no state changes to process. This doesn't actually cause any problems as we'd simply do nothing anyway.
1 parent 3470d04 commit 198486c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog.d/7019.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Port `synapse.handlers.presence` to async/await.

synapse/storage/data_stores/main/state_deltas.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
import logging
1717

18+
from twisted.internet import defer
19+
1820
from synapse.storage._base import SQLBaseStore
1921

2022
logger = logging.getLogger(__name__)
@@ -56,7 +58,7 @@ def get_current_state_deltas(self, prev_stream_id: int, max_stream_id: int):
5658
# if the CSDs haven't changed between prev_stream_id and now, we
5759
# know for certain that they haven't changed between prev_stream_id and
5860
# max_stream_id.
59-
return max_stream_id, []
61+
return defer.succeed((max_stream_id, []))
6062

6163
def get_current_state_deltas_txn(txn):
6264
# First we calculate the max stream id that will give us less than

0 commit comments

Comments
 (0)