From 33d9c5d0eb8ca1200e0f77612cf8f7678f6456d6 Mon Sep 17 00:00:00 2001 From: Sergey Komissarov Date: Mon, 27 Jul 2020 09:07:49 +0000 Subject: [PATCH 1/2] Client method 'execute' consumes 'complete' message in case of error. --- channels_graphql_ws/client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/channels_graphql_ws/client.py b/channels_graphql_ws/client.py index df679bc..390e7c3 100644 --- a/channels_graphql_ws/client.py +++ b/channels_graphql_ws/client.py @@ -163,9 +163,11 @@ async def execute(self, query, variables=None): """ msg_id = await self.start(query, variables=variables) - resp = await self.receive(wait_id=msg_id) - # Consume 'complete' message. - await self.receive(wait_id=msg_id) + try: + resp = await self.receive(wait_id=msg_id) + finally: + # Consume 'complete' message. + await self.receive(wait_id=msg_id) return resp async def subscribe(self, query, *, variables=None, wait_confirmation=True): From bff63f98733a69278866255a4a9e9d35fbea8264 Mon Sep 17 00:00:00 2001 From: Sergey Komissarov Date: Mon, 27 Jul 2020 09:08:26 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Version=20update=20`0.7.3`=E2=86=92=20`0.7.?= =?UTF-8?q?4`=20+=20changelog.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33a0688..be77707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Changelog +## [0.7.4] - 2020-07-27 + +- Client method 'execute' consumes 'complete' message in case of error. + ## [0.7.3] - 2020-07-26 - Logging slightly improved. Thanks to @edouardtheron. diff --git a/pyproject.toml b/pyproject.toml index 29d2135..4ba0b21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ build-backend = "poetry.masonry.api" # Docs: https://python-poetry.org/docs/ [tool.poetry] name = "django-channels-graphql-ws" -version = "0.7.3" +version = "0.7.4" description = """Django Channels based WebSocket GraphQL server with \ Graphene-like subscriptions""" authors = ["Alexander A. Prokhorov "]