-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid invalid state when a connect failed (#1739)
Motivation: The connection manager gets notified when a connect attempt fails and expected to be in the connecting state. Any other state is invalid and will lead to an assertion failure. The manager is notified of connection failures via the channel promise and via the handler (i.e. on `errorCaught(context:error:)`). However, connection failures lead to a state change and will result in crashes in debug builds if a notification is received via both paths. Modifications: - Ignore errors from the channel while in the connecting state and only listen errors from the channel promise callback. - Add test Result: Fewer crashes.
- Loading branch information
Showing
2 changed files
with
50 additions
and
2 deletions.
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