From d7618cd20599cf64ddd6e9dd30b8c64e5baa1fe5 Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Tue, 13 Jun 2023 14:57:38 +0200 Subject: [PATCH 1/3] Fix empty scope when dealing with app service requests --- synapse/types/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/synapse/types/__init__.py b/synapse/types/__init__.py index dfc95e8ebb8a..a82f3cd22f68 100644 --- a/synapse/types/__init__.py +++ b/synapse/types/__init__.py @@ -173,11 +173,15 @@ def deserialize( if input["app_server_id"]: appservice = store.get_app_service_by_id(input["app_server_id"]) + scope = set() + if input["scope"]: + scope.add(input["scope"]) + return Requester( user=UserID.from_string(input["user_id"]), access_token_id=input["access_token_id"], is_guest=input["is_guest"], - scope=set(input["scope"]), + scope=scope, shadow_banned=input["shadow_banned"], device_id=input["device_id"], app_service=appservice, From 678751920a03ada3fc644e796a122c9b9f8d1061 Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Tue, 13 Jun 2023 17:10:54 +0200 Subject: [PATCH 2/3] Shorter version --- synapse/types/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/synapse/types/__init__.py b/synapse/types/__init__.py index a82f3cd22f68..095be070e0c5 100644 --- a/synapse/types/__init__.py +++ b/synapse/types/__init__.py @@ -173,15 +173,11 @@ def deserialize( if input["app_server_id"]: appservice = store.get_app_service_by_id(input["app_server_id"]) - scope = set() - if input["scope"]: - scope.add(input["scope"]) - return Requester( user=UserID.from_string(input["user_id"]), access_token_id=input["access_token_id"], is_guest=input["is_guest"], - scope=scope, + scope=set(input.get("scope", [])), shadow_banned=input["shadow_banned"], device_id=input["device_id"], app_service=appservice, From 7f648f360915cec85ecb29663825721d2262c4a5 Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Tue, 13 Jun 2023 17:26:20 +0200 Subject: [PATCH 3/3] Add changelog --- changelog.d/15774.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/15774.bugfix diff --git a/changelog.d/15774.bugfix b/changelog.d/15774.bugfix new file mode 100644 index 000000000000..c24d6c25e4fc --- /dev/null +++ b/changelog.d/15774.bugfix @@ -0,0 +1 @@ +Fix an error when having workers of different versions running.