django / channels_redis

Redis channel layer backend for Django Channels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

channel_layer.group_add with already existing group removes the group

Mauro-more opened this issue · comments

I am using channels_redis as backend to GraphQL subscriptions.

Upon subscription I subscribe a user to a number of groups, which works as expected. But if in the meantime I change the subscription parameters and call group_add with a different set of groups, the groups that exist on both "previous subscription parameters" and "next subscription parameters" get deleted from channels.

Example: 
    Initial subscription parameters:
        - Group_A
        - Group_B
        - Group_C
    
    Final result:
        - Channels successfully subscribes to all 3 groups
        

    Next subscription parameters:
    - Group_A
    - Group_D

    Final result:
       - Channels subscribes only to Group_D

Is there any config to change this behaviour? Is it a bug? Did anyone experienced it?

Thanks for this awesome project.

commented

Which redis layer are you using, channels_redis.core.RedisChannelLayer or channels_redis.pubsub.RedisPubSubChannelLayer?

Can you provide a code snippets which reproduces your issue?