-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add timeout support when connecting user #3303
Merged
nuno-vieira
merged 29 commits into
develop
from
fix/add-timeout-when-connecting-user-alternative
Jul 18, 2024
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
ed22ea6
Fix broken fake refresh logic in the Demo App
nuno-vieira e70a2e5
Fix Demo App connection banner not showing
nuno-vieira c5895e1
Fix Channel List not hiding error view when data is available
nuno-vieira e7959d0
WIP Add reconnection time out handler
nuno-vieira 4237323
Fix incorrectly considering invalid token as reconnectable
nuno-vieira aa38ee9
Fix trying to connect when network is available
nuno-vieira c93bd81
Fix constantly restarting the reconnection timeout handler
nuno-vieira b86baf4
Add previous state from timeout
nuno-vieira a74035b
Do not observe network status if no user is logged in
nuno-vieira ce576d1
Fix channel list error view animation on the Demo App
nuno-vieira 12e8f96
Revert "Do not observe network status if no user is logged in"
nuno-vieira 5a13120
When coming from offline / inactive state, try to connect in case it …
nuno-vieira b9f264a
Make the reconnection timeout configurable
nuno-vieira 36ad7a2
Fix StreamChatUI tests
nuno-vieira 63424f9
Fix StreamChat Tests compilation
nuno-vieira 0b615e2
Fix web socket connection state tests
nuno-vieira e8714dd
Fix reconnection recovery tests
nuno-vieira f0b21d1
Add timeout testing coverage
nuno-vieira f635d07
Fix expired token being treated as invalid token
nuno-vieira ffeb619
Update CHANGELOG.md
nuno-vieira 362fb39
Update CHANGELOG.md
nuno-vieira 95005cb
Merge branch 'develop' into fix/add-timeout-when-connecting-user-alte…
nuno-vieira 9fde3b8
Revert networking changes logic so that E2E Tests pass and to minimiz…
nuno-vieira d77edba
Fix not able to change chat client config on the demo app once initia…
nuno-vieira 8f3623d
Fix E2E Test not actually waiting for connection and disconnection
nuno-vieira a263a37
Only observe network status when the user is logged in
nuno-vieira 5b0a68d
Fix LLC Tests
nuno-vieira eb86ff1
Make test more robust
nuno-vieira 57d8308
Fix connection recovery handler LLC Tsts
nuno-vieira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
DemoApp/StreamChat/Components/DemoChatChannelListErrorView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// Copyright © 2024 Stream.io Inc. All rights reserved. | ||
// | ||
|
||
import StreamChatUI | ||
import UIKit | ||
|
||
class DemoChatChannelListErrorView: ChatChannelListErrorView { | ||
override func show() { | ||
UIView.animate(withDuration: 0.5) { | ||
self.isHidden = false | ||
} | ||
} | ||
|
||
override func hide() { | ||
UIView.animate(withDuration: 0.5) { | ||
self.isHidden = true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nuno-vieira @martinmitrevski Hello, I found that this code is causing an issue, so I'm leaving a comment.
connectGuestUser
calls logOut first. As a result, ConnectionRecoveryHandler.stop is invoked, causing the monitoring of appDidBecomeActive and appDidEnterBackground to stop. This leads to the issue where "the WebSocket does not reconnect when the app resumes from the background."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I posted issue #3338
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @masarusanjp, thanks for spotting this issue!
The actual issue is that when reconnecting, logOut should not be happening, so the logic should be changed here. Stopping the recovery handler on logout is something that we want, but it caused this unwanted side effect due to the fact that logOutFirst in guest users is not properly implemented, it seems.