Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/19274.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug introduced in 1.143.0 that broke support for older versions of zope-interface.
46 changes: 23 additions & 23 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ dependencies = [
# lives hard (as of 2025-07, distro support is Ubuntu LTS: 22.1, Debian stable: 22.4,
# RHEL 9: 22.10)
"Twisted[tls]>=21.2.0",
# We don't explicitly depend on zope-interface. Twisted pulls it in implicitly as a dependency.
# We add an explicit dependency here to ensure the versions of zope-interface Synapse supports
# includes those which are available on our supported platforms.
# Specifying the dependency explicitly will ensure we test with the lowest version during the
# olddeps CI tests.
# 5.2 is the current version in Debian oldstable. If we don't care to support that, then 5.4 is
# the minimum version from Ubuntu 22.04 and RHEL 9. (as of 2025-12)
"zope-interface>=5.2",
"treq>=21.5.0",
# Twisted has required pyopenssl 16.0 since about Twisted 16.6.
"pyOpenSSL>=16.0.0",
Expand Down Expand Up @@ -260,15 +268,10 @@ select = [
"G",
# pyupgrade
"UP006",
"UP007",
"UP045",
]
extend-safe-fixes = [
# pyupgrade rules compatible with Python >= 3.9
"UP006",
"UP007",
# pyupgrade rules compatible with Python >= 3.10
"UP045",
# Allow ruff to automatically fix trailing spaces within a multi-line string/comment.
"W293"
]
Expand Down
3 changes: 2 additions & 1 deletion synapse/app/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
Awaitable,
Callable,
NoReturn,
Optional,
cast,
)
from wsgiref.simple_server import WSGIServer
Expand Down Expand Up @@ -455,7 +456,7 @@ def listen_http(
root_resource: Resource,
version_string: str,
max_request_body_size: int,
context_factory: IOpenSSLContextFactory | None,
context_factory: Optional[IOpenSSLContextFactory],
reactor: ISynapseReactor = reactor,
) -> list[Port]:
"""
Expand Down
4 changes: 2 additions & 2 deletions synapse/app/admin_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import os
import sys
import tempfile
from typing import Mapping, Sequence
from typing import Mapping, Optional, Sequence

from twisted.internet import defer, task

Expand Down Expand Up @@ -291,7 +291,7 @@ def load_config(argv_options: list[str]) -> tuple[HomeServerConfig, argparse.Nam

def create_homeserver(
config: HomeServerConfig,
reactor: ISynapseReactor | None = None,
reactor: Optional[ISynapseReactor] = None,
) -> AdminCmdServer:
"""
Create a homeserver instance for the Synapse admin command process.
Expand Down
3 changes: 2 additions & 1 deletion synapse/app/generic_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#
import logging
import sys
from typing import Optional

from twisted.web.resource import Resource

Expand Down Expand Up @@ -335,7 +336,7 @@ def load_config(argv_options: list[str]) -> HomeServerConfig:

def create_homeserver(
config: HomeServerConfig,
reactor: ISynapseReactor | None = None,
reactor: Optional[ISynapseReactor] = None,
) -> GenericWorkerServer:
"""
Create a homeserver instance for the Synapse worker process.
Expand Down
4 changes: 2 additions & 2 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import logging
import os
import sys
from typing import Iterable
from typing import Iterable, Optional

from twisted.internet.tcp import Port
from twisted.web.resource import EncodingResourceWrapper, Resource
Expand Down Expand Up @@ -350,7 +350,7 @@ def load_or_generate_config(argv_options: list[str]) -> HomeServerConfig:

def create_homeserver(
config: HomeServerConfig,
reactor: ISynapseReactor | None = None,
reactor: Optional[ISynapseReactor] = None,
) -> SynapseHomeServer:
"""
Create a homeserver instance for the Synapse main process.
Expand Down
4 changes: 2 additions & 2 deletions synapse/handlers/delayed_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#

import logging
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Optional

from twisted.internet.interfaces import IDelayedCall

Expand Down Expand Up @@ -74,7 +74,7 @@ def __init__(self, hs: "HomeServer"):
cfg=self._config.ratelimiting.rc_delayed_event_mgmt,
)

self._next_delayed_event_call: IDelayedCall | None = None
self._next_delayed_event_call: Optional[IDelayedCall] = None

# The current position in the current_state_delta stream
self._event_pos: int | None = None
Expand Down
4 changes: 2 additions & 2 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import logging
import random
from http import HTTPStatus
from typing import TYPE_CHECKING, Any, Mapping, Sequence
from typing import TYPE_CHECKING, Any, Mapping, Optional, Sequence

from canonicaljson import encode_canonical_json

Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(self, hs: "HomeServer"):

# The scheduled call to self._expire_event. None if no call is currently
# scheduled.
self._scheduled_expiry: IDelayedCall | None = None
self._scheduled_expiry: Optional[IDelayedCall] = None

if not hs.config.worker.worker_app:
self.hs.run_as_background_process(
Expand Down
4 changes: 2 additions & 2 deletions synapse/handlers/user_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import logging
from http import HTTPStatus
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Optional

from twisted.internet.interfaces import IDelayedCall

Expand Down Expand Up @@ -125,7 +125,7 @@ def __init__(self, hs: "HomeServer"):
# Guard to ensure we only have one process for refreshing remote profiles
self._is_refreshing_remote_profiles = False
# Handle to cancel the `call_later` of `kick_off_remote_profile_refresh_process`
self._refresh_remote_profiles_call_later: IDelayedCall | None = None
self._refresh_remote_profiles_call_later: Optional[IDelayedCall] = None

# Guard to ensure we only have one process for refreshing remote profiles
# for the given servers.
Expand Down
Loading
Loading