Hi,
we are working with a self-hosted deployment (a docker setup) with skygear-server and skygear-chat. There is an iOS app (Skygear iOS SDK) which registers a user and an Angular application (Skygear JavaScript library) which register as well a user and then they communicate together in a group channel.
There is a bug that for some of the users we do not get the new messages in the angular app (if we reload the conversation, they are there, but we do not get informed even if we are subscribed). After some research we found out, that these users which are sometimes not working have 2 user channels in the database, but skygear loads only one per user and it is random which one (SQL query with Limit 1) (https://github.com/SkygearIO/chat/blob/b712e5c36df4086cc581e5f09ff6759410a762c6/chat/utils.py -> Line 26). If I manually delete one in the database, then user is working well.
Now my question:
- Why does some users have one user channel and some have two?
- Who exactly creates these channels and what are they used for?
- Could you fix these problem by either prevent that multiple user channels are created or that you load all user channels when you want to inform the user?
- Do we need to change something in our code so that these user channels are not created?
We would appreciate you help since this is a blocker for our application.
(This bug is the same as we mentioned in Problem with JS SDK message subscriprion, but back then, we did not have enough information to actually see what the problem was, and it was sometimes was gone since it works fine for some of the users).
Thanks for your help,
Adrian