question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Subscription not processing

See original GitHub issue

Overview

When a subscription is created, it never produces a response. GraphiQL stays in the loading screen.

This is using the example code from this project and I haven’t made any changes. But I did try setting the confirm_subscriptions option on the GraphqlWsConsumer to True, which didn’t change anything (I thought it might).

Environment

Python: 3.7.0 django: 2.2.1 django-channels-graphql-ws: 0.2.0 OS: Ubuntu 18.04.2 LTS

Steps to reproduce

  1. Install dependencies

  2. Run ./manage.py runserver in the example directory

  3. Open GraphiQL at http://127.0.0.1:8000/

  4. Create a subscription:

subscription {
  onChatMessageSent(chatroom: "room1", username: "testuser") {
    message
  }
}

No response will be given.

  1. Send a chat message:
mutation {
  sendChatMessage(chatroom: "room1", username: "testuser", message: "testing") {
    ok
  }
}

There will still be no response from the subscription.

The following errors are thrown in the browser console:

Firefox can’t establish a connection to the server at ws://127.0.0.1:8000/graphql/. 
The connection to ws://127.0.0.1:8000/graphql/ was interrupted while the page was loading.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
hozblokcommented, May 13, 2019

Hi @dspacejs ,

In the example in the publish method of OnNewChatMessage subscription there is such code:

# Avoid self-notifications.
if sender == username:
    return OnNewChatMessage.SKIP

return OnNewChatMessage(chatroom=chatroom, message=message, sender=sender)

If you send messages as the testuser user and subscribe as the testuser user, then you do not receive notifications. In other words, being in a chat you only receive other people’s messages, but not your own. So you can change username of the mutation to get notifications. Or you can comment out this condition to duplicate outgoing messages in your inbox.

Does my answer help solve the problem?

0reactions
prokhercommented, Aug 13, 2019

It seems the original problem is solved, so I am closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix problems with subscriptions - Android - Google Play Help
Find missing subscriptions. If you can't find your subscriptions, check that you're signed in to the correct account. Make sure to sign in ......
Read more >
App subscription not working - Apple Community
First, check out the "If you don't see the subscription that you're looking for" section of this article: View, change, or cancel your ......
Read more >
Subscription not processing after lapse in payment. : r/ffxiv
It looks like I was getting an error at the end of the payment process due to using a vpn. I was unable...
Read more >
How subscriptions work | Stripe Documentation
If the subscription is incomplete and you void the first invoice that's generated, the subscription updates to incomplete_expired . If you void the...
Read more >
Troubleshoot Subscriptions - Tableau Help
However, if the background process is handling an extraordinarily large and complex dashboard, that may not be enough time. You can check the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found