From 3d65784d6be8638b640cdaf408db53731b585c1d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 8 Jul 2022 20:17:13 -0600 Subject: [PATCH 1/4] Fix appservice EDUs failing to send if the EDU doesn't have a room ID As is in the case of presence. --- synapse/appservice/scheduler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py index de5e5216c223..b0f9b9a818b7 100644 --- a/synapse/appservice/scheduler.py +++ b/synapse/appservice/scheduler.py @@ -319,7 +319,8 @@ async def _compute_msc3202_otk_counts_and_fallback_keys( rooms_of_interesting_users.update(event.room_id for event in events) # EDUs rooms_of_interesting_users.update( - ephemeral["room_id"] for ephemeral in ephemerals + ephemeral["room_id"] for ephemeral in ephemerals if + ephemeral.get("room_id") is not None ) # Look up the AS users in those rooms From cef3b0c4b2ec8bd0995845ec06acddf0a2ff32e3 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 8 Jul 2022 20:19:23 -0600 Subject: [PATCH 2/4] changelog --- changelog.d/13236.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/13236.bugfix diff --git a/changelog.d/13236.bugfix b/changelog.d/13236.bugfix new file mode 100644 index 000000000000..7fddc4413dfd --- /dev/null +++ b/changelog.d/13236.bugfix @@ -0,0 +1 @@ +Fix appservices not receiving room-less EDUs, like presence, if enabled. \ No newline at end of file From bec49be4d771d52bab72794485f84fe8eb2a532c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 8 Jul 2022 20:20:43 -0600 Subject: [PATCH 3/4] linter --- synapse/appservice/scheduler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py index b0f9b9a818b7..6106fd5303a2 100644 --- a/synapse/appservice/scheduler.py +++ b/synapse/appservice/scheduler.py @@ -319,7 +319,8 @@ async def _compute_msc3202_otk_counts_and_fallback_keys( rooms_of_interesting_users.update(event.room_id for event in events) # EDUs rooms_of_interesting_users.update( - ephemeral["room_id"] for ephemeral in ephemerals if + ephemeral["room_id"] + for ephemeral in ephemerals if ephemeral.get("room_id") is not None ) From d2451f5c3d6afc861d7df4cd926f7e2ccdec76ac Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 8 Jul 2022 20:22:56 -0600 Subject: [PATCH 4/4] fix linter again --- synapse/appservice/scheduler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py index 6106fd5303a2..6c8695346ff2 100644 --- a/synapse/appservice/scheduler.py +++ b/synapse/appservice/scheduler.py @@ -320,8 +320,8 @@ async def _compute_msc3202_otk_counts_and_fallback_keys( # EDUs rooms_of_interesting_users.update( ephemeral["room_id"] - for ephemeral in ephemerals if - ephemeral.get("room_id") is not None + for ephemeral in ephemerals + if ephemeral.get("room_id") is not None ) # Look up the AS users in those rooms