matrix-org / sygnal

Sygnal: reference Push Gateway for Matrix
Apache License 2.0
167 stars 148 forks source link

Fix breakage with `aiohttp>=3.10.0` when using GCM and an HTTP proxy #395

Closed anoadragon453 closed 2 months ago

anoadragon453 commented 2 months ago

Since aiohttp==3.10.0, instantiating aiohttp.ClientSession must be done from an async function. Calling this from a non-async function relied on deprecated behaviour in Python, which broke in recent releases. https://github.com/aio-libs/aiohttp/issues/8555#issuecomment-2263814747 explains the situation.

We would do this when using GCM + an HTTP proxy:

https://github.com/matrix-org/sygnal/blob/345aa61a59cebc2b87a7375ab696838f98e37097/sygnal/gcmpushkin.py#L213-L217

Rather than pin aiohttp to an older version, let's just fix the behaviour. Supersedes https://github.com/matrix-org/sygnal/pull/394.