Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c[3001,"Connection aborted"] #173

Open
cdvv7788 opened this issue Nov 5, 2015 · 1 comment
Open

c[3001,"Connection aborted"] #173

cdvv7788 opened this issue Nov 5, 2015 · 1 comment

Comments

@cdvv7788
Copy link

cdvv7788 commented Nov 5, 2015

I am trying to setup a simple flow for notifications. Something like:

class NotificationRouter(ModelPubRouter):
    route_name = 'notification-router'
    valid_verbs = ['subscribe']
    model = Notification
    serializer_class = NotificationSerializer

    def get_subscription_channels(self, **kwargs):
        return ['notification']

route_handler.register(NotificationRouter)

The serializer is just a ModelSerializer that should return the id:

class NotificationSerializer(ModelSerializer):
    class Meta:
        model = 'notifications.models.Notification'
        publish_fields = ('id', )

On javascript i am trying to subscribe, but all i am getting is c[3001,"Connection aborted"]. The subscribe() function is not even calling it's failure function.
swampdragon.ready is being reached tho.

I can't find the cause of this error anywhere, and the dragon server is quite silent, which does not help either. What's your approach to debugging issues like these?

@AlexejStukov
Copy link

You are using ModelPubRouter and should therefore overwrite get_subscription_context and not get_subscription_channels (documentation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants