summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-17 13:23:44 +0100
committerErik Johnston <erik@matrix.org>2015-08-17 13:23:44 +0100
commitafef6f5d16d9600e11cc2e33efcbcc5fa8b9509f (patch)
treeccb3670a75ce04f1a0e87c68bd99f6a8cc02bdc0 /synapse/storage
parentBatch _get_linearized_receipts_for_rooms (diff)
parentFix bug where we were leaking None into state event lists (diff)
downloadsynapse-afef6f5d16d9600e11cc2e33efcbcc5fa8b9509f.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/receipts_take2
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/registration.py12
-rw-r--r--synapse/storage/state.py5
2 files changed, 9 insertions, 8 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index aa446f94c6..bf803f2c6e 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -112,16 +112,16 @@ class RegistrationStore(SQLBaseStore):
         })
 
     @defer.inlineCallbacks
-    def user_delete_access_tokens_apart_from(self, user_id, token_id):
+    def user_delete_access_tokens(self, user_id):
         yield self.runInteraction(
-            "user_delete_access_tokens_apart_from",
-            self._user_delete_access_tokens_apart_from, user_id, token_id
+            "user_delete_access_tokens",
+            self._user_delete_access_tokens, user_id
         )
 
-    def _user_delete_access_tokens_apart_from(self, txn, user_id, token_id):
+    def _user_delete_access_tokens(self, txn, user_id):
         txn.execute(
-            "DELETE FROM access_tokens WHERE user_id = ? AND id != ?",
-            (user_id, token_id)
+            "DELETE FROM access_tokens WHERE user_id = ?",
+            (user_id, )
         )
 
     @defer.inlineCallbacks
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 185f88fd7c..ecb62e6dfd 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -412,9 +412,10 @@ class StateStore(SQLBaseStore):
                 full=(types is None),
             )
 
-            results[group].update({
+            # We replace here to remove all the entries with None values.
+            results[group] = {
                 key: value for key, value in state_dict.items() if value
-            })
+            }
 
         defer.returnValue(results)