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

Using ChatViewController second time doesn't work #3

Closed
mpodeszwa opened this issue Aug 27, 2019 · 5 comments
Closed

Using ChatViewController second time doesn't work #3

mpodeszwa opened this issue Aug 27, 2019 · 5 comments
Assignees

Comments

@mpodeszwa
Copy link
Contributor

What did you do?

I created ChatViewController using code:

channelPresenter = ChannelPresenter(channel: channel)
channelPresenter?.reload()

Chat is being presented to the user after logging in to the application. When user enters the app chat is working properly. However, when he logs out and logs back in (to the same account or a different one) chat is not loading.

What did you expect to happen?

Chat is working every time.

What happened instead?

Second ChatViewController never gets refreshed

GetStream Environment

GetStream Chat version: 1.2.5
iOS version: 12.4
Swift version: 5.0.1
Xcode version: 10.3
Device: iPhone Xs

Additional context

There are some logs.

First time ChatViewController is created:

📱  App state active
🕸  Available 🙋‍♂️
🐴 [27/08/2019 11:36:58.812] 🎫 Skip read.
🦄 [27/08/2019 11:36:59.075] ❤️ Connecting...
🦄 [27/08/2019 11:36:59.075] ➡️ GET wss://chat-us-east-1.stream-io-api.com/connect?......&stream-auth-type=jwt
🦄 [27/08/2019 11:36:59.076] Request headers:
◾️ Origin = wss://chat-us-east-1.stream-io-api.com

🦄 [27/08/2019 11:37:00.342] WebSocket connected. Waiting for the first health check message...
🦄 [27/08/2019 11:37:00.402] 📦 {
  "created_at" : "2019-08-27T09:37:00.28453431Z",
  ....
}
🦄 [27/08/2019 11:37:00.405] 🥰 Connected

.... more responses

Logging out:

🦄 [27/08/2019 11:37:06.995] 💔 Disconnected deliberately

Logging back in to the same account (same channel id, different instances of ChatViewController and ChatPresenter):

📱  App state active
🕸  Available 🙋‍♂️
🐴 [27/08/2019 11:37:19.012] 🎫 Skip read.
🦄 [27/08/2019 11:37:19.018] ❤️ Connecting...
🦄 [27/08/2019 11:37:19.019] ➡️ GET wss://chat-us-east-1.stream-io-api.com/connect?....&stream-auth-type=jwt
🦄 [27/08/2019 11:37:19.019] Request headers:
◾️ Origin = wss://chat-us-east-1.stream-io-api.com

🐴 [27/08/2019 11:37:19.059] 🎫 Skip read.

Additional info:

There are no memory leaks, however I can see instances of following types still existing after logging out:

Client
ClientURLSessionTaskDelegate
InternetConnection
WebSocket
@buh
Copy link
Contributor

buh commented Aug 27, 2019

@mpodeszwa thanks for the reporting. I'll check your logout/login issue. For now the Client is used as a shared instance and it will be in memory after logout. It holds web socket and other needed objects.

@buh
Copy link
Contributor

buh commented Aug 27, 2019

@mpodeszwa I've tested logout and login in the example project and it works without any issues. How are you doing logout? Could you send me all logs?

@buh buh closed this as completed Aug 27, 2019
@tbarbugli
Copy link
Member

why was this closed?

@tbarbugli tbarbugli reopened this Aug 28, 2019
@buh
Copy link
Contributor

buh commented Aug 28, 2019

@mpodeszwa Please, check a new version 1.2.6

@buh buh closed this as completed Aug 28, 2019
@mpodeszwa
Copy link
Contributor Author

@buh Thanks, it's now working as expected 👍

buh added a commit that referenced this issue Feb 4, 2020
buh added a commit that referenced this issue Mar 11, 2020
buh added a commit that referenced this issue Mar 11, 2020
buh added a commit that referenced this issue Mar 11, 2020
buh added a commit that referenced this issue Mar 11, 2020
buh added a commit that referenced this issue Mar 11, 2020
buh added a commit that referenced this issue Mar 22, 2020
b-onc pushed a commit that referenced this issue Apr 2, 2020
b-onc pushed a commit that referenced this issue Apr 2, 2020
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

3 participants