From 3c741682e59a41fcc45a5b9a370c7f268be7729e Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 14 Apr 2015 09:54:44 +0100 Subject: [PATCH] Correctly increment the _next_id initially --- synapse/storage/util/id_generators.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/synapse/storage/util/id_generators.py b/synapse/storage/util/id_generators.py index 8f419323a..2e2a40898 100644 --- a/synapse/storage/util/id_generators.py +++ b/synapse/storage/util/id_generators.py @@ -55,9 +55,11 @@ class IdGenerator(object): ) val, = txn.fetchone() - self._next_id = val or 2 + cur = val or 0 + cur += 1 + self._next_id = cur + 1 - return 1 + return cur class StreamIdGenerator(object):