summary refs log tree commit diff
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2023-08-10 17:28:31 +0000
committerGitHub <noreply@github.com>2023-08-10 18:28:31 +0100
commit7f4b41369049c143919d229670087df69edb9602 (patch)
treefbb23bb9c05435eb0eda85a1c2dddc56d29779df
parentClean-up presence code (#16092) (diff)
downloadsynapse-7f4b41369049c143919d229670087df69edb9602.tar.xz
Fix the type annotation on `run_db_interaction` in the Module API. (#16089)
* Fix the method signature of `run_db_interaction` on the module API

* Newsfile

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>

---------

Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
-rw-r--r--changelog.d/16089.misc1
-rw-r--r--synapse/module_api/__init__.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/16089.misc b/changelog.d/16089.misc
new file mode 100644
index 0000000000..8c302e6884
--- /dev/null
+++ b/changelog.d/16089.misc
@@ -0,0 +1 @@
+Fix the type annotation on `run_db_interaction` in the Module API.
\ No newline at end of file
diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py
index acee1dafd3..9ad8e038ae 100644
--- a/synapse/module_api/__init__.py
+++ b/synapse/module_api/__init__.py
@@ -31,7 +31,7 @@ from typing import (
 
 import attr
 import jinja2
-from typing_extensions import ParamSpec
+from typing_extensions import Concatenate, ParamSpec
 
 from twisted.internet import defer
 from twisted.internet.interfaces import IDelayedCall
@@ -885,7 +885,7 @@ class ModuleApi:
     def run_db_interaction(
         self,
         desc: str,
-        func: Callable[P, T],
+        func: Callable[Concatenate[LoggingTransaction, P], T],
         *args: P.args,
         **kwargs: P.kwargs,
     ) -> "defer.Deferred[T]":