mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 23:03:52 -05:00
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/dm_room_upgrade
This commit is contained in:
commit
4026d555fa
32 changed files with 557 additions and 124 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue