summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2022-03-30 12:10:12 +0100
committerGitHub <noreply@github.com>2022-03-30 11:10:12 +0000
commitc8cbd66d3ba6a6212c0934fcb9aa9b791797c269 (patch)
tree0246f10fe8bdac37a55891412be8f1c514dbaf7b /synapse/storage
parentDisable proactive sends for remote joins (#12330) (diff)
downloadsynapse-c8cbd66d3ba6a6212c0934fcb9aa9b791797c269.tar.xz
Start application service stream token tracking from 1 (#12193)
Co-authored-by: Erik Johnston <erik@matrix.org>
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/databases/main/appservice.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/appservice.py b/synapse/storage/databases/main/appservice.py
index 0694446558..abea4383c7 100644
--- a/synapse/storage/databases/main/appservice.py
+++ b/synapse/storage/databases/main/appservice.py
@@ -446,7 +446,8 @@ class ApplicationServiceTransactionWorkerStore(
             )
             last_stream_id = txn.fetchone()
             if last_stream_id is None or last_stream_id[0] is None:  # no row exists
-                return 0
+                # Stream tokens always start from 1, to avoid foot guns around `0` being falsey.
+                return 1
             else:
                 return int(last_stream_id[0])