summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-01-28 14:08:24 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2019-01-28 14:08:24 +0000
commit4026d555fabe6f00d865a0c63226799e53a092e1 (patch)
tree9a8211924748e48915e1acf6d097e0bff88a03bb /synapse/storage
parentReuse predecessor method (diff)
parentRemove --process-dependency-links from UPGRADE.rst (#4485) (diff)
downloadsynapse-4026d555fabe6f00d865a0c63226799e53a092e1.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/dm_room_upgrade
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/engines/sqlite.py11
-rw-r--r--synapse/storage/events_worker.py8
2 files changed, 9 insertions, 10 deletions
diff --git a/synapse/storage/engines/sqlite.py b/synapse/storage/engines/sqlite.py
index c64d73ff21..31b8449ca1 100644
--- a/synapse/storage/engines/sqlite.py
+++ b/synapse/storage/engines/sqlite.py
@@ -15,7 +15,6 @@
 
 import struct
 import threading
-from sqlite3 import sqlite_version_info
 
 from synapse.storage.prepare_database import prepare_database
 
@@ -34,10 +33,14 @@ class Sqlite3Engine(object):
     @property
     def can_native_upsert(self):
         """
-        Do we support native UPSERTs? This requires SQLite3 3.24+, plus some
-        more work we haven't done yet to tell what was inserted vs updated.
+        Do we support native UPSERTs?
         """
-        return sqlite_version_info >= (3, 24, 0)
+        # SQLite3 3.24+ supports them, but empirically the unit tests don't work
+        # when its enabled.
+        # FIXME: Figure out what is wrong so we can re-enable native upserts
+
+        # return self.module.sqlite_version_info >= (3, 24, 0)
+        return False
 
     def check_database(self, txn):
         pass
diff --git a/synapse/storage/events_worker.py b/synapse/storage/events_worker.py
index 599f892858..0a0ca58fc4 100644
--- a/synapse/storage/events_worker.py
+++ b/synapse/storage/events_worker.py
@@ -23,7 +23,7 @@ from twisted.internet import defer
 
 from synapse.api.constants import EventFormatVersions
 from synapse.api.errors import NotFoundError
-from synapse.events import FrozenEvent
+from synapse.events import FrozenEvent, event_type_from_format_version  # noqa: F401
 # these are only included to make the type annotations work
 from synapse.events.snapshot import EventContext  # noqa: F401
 from synapse.events.utils import prune_event
@@ -412,11 +412,7 @@ class EventsWorkerStore(SQLBaseStore):
                 # of a event format version, so it must be a V1 event.
                 format_version = EventFormatVersions.V1
 
-            # TODO: When we implement new event formats we'll need to use a
-            # different event python type
-            assert format_version == EventFormatVersions.V1
-
-            original_ev = FrozenEvent(
+            original_ev = event_type_from_format_version(format_version)(
                 event_dict=d,
                 internal_metadata_dict=internal_metadata,
                 rejected_reason=rejected_reason,