PhoenixChannel using previous user's topic(not a bug need a help!) #77
Unanswered
freewebwithme
asked this question in
Q&A
Replies: 1 comment
-
Try to use channel.close() and socket.close() and reopen it after relogin |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My scenario is like this.
I created 2 users on simulator for testing.
When I log in the app, my app will connect socket and add channel with topic like this
And then when I add a item to cart using this function
It works but
When I switch to another user (app doesn't restart, just lot out and log in with another user),
My channel object is using previous users' channel.
I inspect it using
print(channel!.topic);
It shows me
cart:1(previous user)
instead ofcart:2(current user)
I tried leaving channel when user logs out.
But it still uses previous channel with topic.
I know this problem is from my source code not from this package. but I am stuck on this for couple of days.
So Please give me an advice!
Beta Was this translation helpful? Give feedback.
All reactions