summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-07 10:24:50 +0100
committerErik Johnston <erik@matrix.org>2016-06-07 10:24:50 +0100
commit84379062f9ec259abc302af321d4ed8f5a958c01 (patch)
tree3ff79458bbbcdf1bb2c82ccccf3bb0b2cd29aede
parentFix AS retries (diff)
downloadsynapse-84379062f9ec259abc302af321d4ed8f5a958c01.tar.xz
Fix AS retries, but with correct ordering
-rw-r--r--synapse/storage/appservice.py4
-rw-r--r--tests/storage/test_appservice.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/synapse/storage/appservice.py b/synapse/storage/appservice.py
index a281571637..d1ee533fac 100644
--- a/synapse/storage/appservice.py
+++ b/synapse/storage/appservice.py
@@ -320,10 +320,10 @@ class ApplicationServiceTransactionStore(SQLBaseStore):
 
         event_ids = json.loads(entry["event_ids"])
 
-        event_map = yield self.get_events(event_ids)
+        events = yield self._get_events(event_ids)
 
         defer.returnValue(AppServiceTransaction(
-            service=service, id=entry["txn_id"], events=event_map.values()
+            service=service, id=entry["txn_id"], events=events
         ))
 
     def _get_oldest_unsent_txn(self, txn, service):
diff --git a/tests/storage/test_appservice.py b/tests/storage/test_appservice.py
index 6db4b966db..3e2862daae 100644
--- a/tests/storage/test_appservice.py
+++ b/tests/storage/test_appservice.py
@@ -353,21 +353,21 @@ class ApplicationServiceTransactionStoreTestCase(unittest.TestCase):
     @defer.inlineCallbacks
     def test_get_oldest_unsent_txn(self):
         service = Mock(id=self.as_list[0]["id"])
-        events = {"e1": Mock(event_id="e1"), "e2": Mock(event_id="e2")}
+        events = [Mock(event_id="e1"), Mock(event_id="e2")]
         other_events = [Mock(event_id="e5"), Mock(event_id="e6")]
 
         # we aren't testing store._base stuff here, so mock this out
-        self.store.get_events = Mock(return_value=events)
+        self.store._get_events = Mock(return_value=events)
 
         yield self._insert_txn(self.as_list[1]["id"], 9, other_events)
-        yield self._insert_txn(service.id, 10, events.values())
+        yield self._insert_txn(service.id, 10, events)
         yield self._insert_txn(service.id, 11, other_events)
         yield self._insert_txn(service.id, 12, other_events)
 
         txn = yield self.store.get_oldest_unsent_txn(service)
         self.assertEquals(service, txn.service)
         self.assertEquals(10, txn.id)
-        self.assertEquals(events.values(), txn.events)
+        self.assertEquals(events, txn.events)
 
     @defer.inlineCallbacks
     def test_get_appservices_by_state_single(self):