Remove sticky events SQLite version checking

This commit is contained in:
Olivier 'reivilibre committed 2026-10-28 14:48:53 +00:00
1 parent 5bb0f08a6a
commit 69918ef2d5
8 files changed
-56

No files matched your search

@@ -128,16 +128,6 @@ class StickyEventsWorkerStore(StateGroupWorkerStore, CacheInvalidationWorkerStor
writers=hs.config.worker.writers.events,
)
if hs.config.experimental.msc4354_enabled and isinstance(
self.database_engine, Sqlite3Engine
):
import sqlite3
if sqlite3.sqlite_version_info < (3, 40, 0):
raise RuntimeError(
f"Experimental MSC4354 Sticky Events enabled but SQLite3 version is too old: {sqlite3.sqlite_version_info}, must be at least 3.40. Disable MSC4354 Sticky Events, switch to Postgres, or upgrade SQLite. See https://github.com/element-hq/synapse/issues/19428"
)
def process_replication_position(
self, stream_name: str, instance_name: str, token: int
) -> None:
@@ -1,4 +1,3 @@
import sqlite3
from typing import Callable, Collection
from unittest import mock
from unittest.mock import Mock
@@ -24,7 +23,6 @@ from synapse.util.retryutils import NotRetryingDestination
from tests.test_utils import event_injection
from tests.unittest import FederatingHomeserverTestCase
from tests.utils import USE_POSTGRES_FOR_TESTS
class _FederationCatchUpTestCaseBase(FederatingHomeserverTestCase):
@@ -610,9 +608,6 @@ class FederationStickyEventCatchUpTestCase(_FederationCatchUpTestCaseBase):
Tests for the catch-up of backlogged sticky events over federation.
"""
if not USE_POSTGRES_FOR_TESTS and sqlite3.sqlite_version_info < (3, 40, 0):
skip = f"SQLite version is too old to support sticky events: {sqlite3.sqlite_version_info} (See https://github.com/element-hq/synapse/issues/19428)"
def default_config(self) -> JsonDict:
config = super().default_config()
config["experimental_features"] = {"msc4354_enabled": True}
@@ -11,7 +11,6 @@
# See the GNU Affero General Public License for more details:
# <https://www.gnu.org/licenses/agpl-3.0.html>.
import logging
import sqlite3
from contextlib import contextmanager
from typing import Iterator
from unittest.mock import AsyncMock
@@ -27,7 +26,6 @@ from synapse.util.clock import Clock
from synapse.util.duration import Duration
from tests.replication._base import BaseMultiWorkerStreamTestCase
from tests.utils import USE_POSTGRES_FOR_TESTS
logger = logging.getLogger(__name__)
@@ -37,10 +35,6 @@ class ShardedStickyEventsTestCase(BaseMultiWorkerStreamTestCase):
Tests for sharded Sticky Events.
"""
if not USE_POSTGRES_FOR_TESTS and sqlite3.sqlite_version_info < (3, 40, 0):
# We need the JSON functionality in SQLite
skip = f"SQLite version is too old to support sticky events: {sqlite3.sqlite_version_info} (See https://github.com/element-hq/synapse/issues/19428)"
servlets = [
synapse.rest.admin.register_servlets_for_client_rest_resource,
login.register_servlets,
@@ -12,7 +12,6 @@
# <https://www.gnu.org/licenses/agpl_3.0.html>.
#
import logging
import sqlite3
from twisted.internet.testing import MemoryReactor
@@ -27,7 +26,6 @@ from synapse.util.duration import Duration
from tests.rest.client.sliding_sync.test_sliding_sync import SlidingSyncBase
from tests.server import TimedOutException
from tests.utils import USE_POSTGRES_FOR_TESTS
logger = logging.getLogger(__name__)
@@ -60,10 +58,6 @@ ROOM_SUBSCRIPTION = {"required_state": [], "timeline_limit": 0}
class SlidingSyncStickyEventsExtensionTestCase(SlidingSyncBase):
"""Tests for the sticky events sliding sync extension"""
if not USE_POSTGRES_FOR_TESTS and sqlite3.sqlite_version_info < (3, 40, 0):
# We need the JSON functionality in SQLite
skip = f"SQLite version is too old to support sticky events: {sqlite3.sqlite_version_info} (See https://github.com/element-hq/synapse/issues/19428)"
servlets = [
synapse.rest.admin.register_servlets,
login.register_servlets,
-8
View File
@@ -14,7 +14,6 @@
"""Tests REST events for /delayed_events paths."""
import sqlite3
from http import HTTPStatus
from typing import Literal, overload
from unittest.mock import Mock, patch
@@ -54,7 +53,6 @@ from tests import unittest
from tests.replication._base import BaseMultiWorkerStreamTestCase
from tests.server import FakeChannel, make_request
from tests.unittest import HomeserverTestCase
from tests.utils import USE_POSTGRES_FOR_TESTS
_MANAGEMENT_PATH_PREFIX = "/_matrix/client/unstable/org.matrix.msc4140/delayed_events"
@@ -1503,12 +1501,6 @@ class DelayedEventsTestCase(DelayedEventsTestCaseBase):
class DelayedStickyEventsTestCase(DelayedEventsTestCaseBase):
"""Tests scheduling delayed sticky events (MSC4354)."""
if not USE_POSTGRES_FOR_TESTS and sqlite3.sqlite_version_info < (3, 40, 0):
# We need the JSON functionality in SQLite
# (the sticky events store refuses to start without it, so this has to be
# a class-level skip: the homeserver is built before the test body runs)
skip = f"SQLite version is too old to support sticky events: {sqlite3.sqlite_version_info} (See https://github.com/element-hq/synapse/issues/19428)"
def default_config(self) -> JsonDict:
config = super().default_config()
config["experimental_features"] = {"msc4354_enabled": True}
-6
View File
@@ -13,7 +13,6 @@
#
#
import sqlite3
from http import HTTPStatus
from twisted.internet.testing import MemoryReactor
@@ -27,7 +26,6 @@ from synapse.util.clock import Clock
from synapse.util.duration import Duration
from tests import unittest
from tests.utils import USE_POSTGRES_FOR_TESTS
class StickyEventsClientTestCase(unittest.HomeserverTestCase):
@@ -35,10 +33,6 @@ class StickyEventsClientTestCase(unittest.HomeserverTestCase):
Tests for the client-server API parts of MSC4354: Sticky Events
"""
if not USE_POSTGRES_FOR_TESTS and sqlite3.sqlite_version_info < (3, 40, 0):
# We need the JSON functionality in SQLite
skip = f"SQLite version is too old to support sticky events: {sqlite3.sqlite_version_info} (See https://github.com/element-hq/synapse/issues/19428)"
servlets = [
room.register_servlets,
login.register_servlets,
@@ -11,7 +11,6 @@
# See the GNU Affero General Public License for more details:
# <https://www.gnu.org/licenses/agpl-3.0.html>.
import json
import sqlite3
from dataclasses import dataclass
from http import HTTPStatus
from unittest.mock import patch
@@ -28,7 +27,6 @@ from synapse.util.clock import Clock
from synapse.util.duration import Duration
from tests import unittest
from tests.utils import USE_POSTGRES_FOR_TESTS
@dataclass
@@ -68,10 +66,6 @@ class SyncStickyEventsTestCase(unittest.HomeserverTestCase):
Tests for oldschool (v3) /sync with sticky events (MSC4354)
"""
if not USE_POSTGRES_FOR_TESTS and sqlite3.sqlite_version_info < (3, 40, 0):
# We need the JSON functionality in SQLite
skip = f"SQLite version is too old to support sticky events: {sqlite3.sqlite_version_info} (See https://github.com/element-hq/synapse/issues/19428)"
servlets = [
room.register_servlets,
login.register_servlets,
-9
View File
@@ -10,7 +10,6 @@
#
# See the GNU Affero General Public License for more details:
# <https://www.gnu.org/licenses/agpl-3.0.html>.
import sqlite3
from http import HTTPStatus
from immutabledict import immutabledict
@@ -40,7 +39,6 @@ from tests.test_utils.event_injection import (
inject_event,
inject_member_event,
)
from tests.utils import USE_POSTGRES_FOR_TESTS
class StickyEventsTestCase(unittest.HomeserverTestCase):
@@ -48,10 +46,6 @@ class StickyEventsTestCase(unittest.HomeserverTestCase):
Tests for the storage functions related to MSC4354: Sticky Events
"""
if not USE_POSTGRES_FOR_TESTS and sqlite3.sqlite_version_info < (3, 40, 0):
# We need the JSON functionality in SQLite
skip = f"SQLite version is too old to support sticky events: {sqlite3.sqlite_version_info} (See https://github.com/element-hq/synapse/issues/19428)"
servlets = [
room.register_servlets,
sync.register_servlets,
@@ -904,9 +898,6 @@ class StickyEventsFederationBacklogTestCase(unittest.HomeserverTestCase):
federation catch-up transaction.
"""
if not USE_POSTGRES_FOR_TESTS and sqlite3.sqlite_version_info < (3, 40, 0):
skip = f"SQLite version is too old to support sticky events: {sqlite3.sqlite_version_info} (See https://github.com/element-hq/synapse/issues/19428)"
servlets = [
room.register_servlets,
login.register_servlets,