-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
Describe the Bug
After Fix connection race when using WSEngine was merged, the isConnecting
property was introduced to prevent multiple connection attempts. However, as reported in this comment, isConnecting
sometimes remains true
, which prevents users from reconnecting indefinitely.
Steps to Reproduce
- Call
connect()
- Put the device into sleep mode so that the WebSocket connection closes.
- The server goes down while the device is asleep.
- Call
connect()
again to attempt a reconnection. - The server is back online.
- The
isConnecting
flag remainstrue
, preventingconnect()
from proceeding.
Expected Behavior
- The WebSocket can reconnect when the server is back online.
- The
isConnecting
flag should be reset tofalse
once a previous connection attempt fails, allowing new connections.
Environment
- OS/Version: iOS 18.3.1
- Starscream Version: 4.0.6 and later
- Xcode Version: 16.0
Additional Context
- This issue is caused by
isConnecting
stayingtrue
after a failed connection attempt. - A potential fix might involve resetting
isConnecting
when a connection is explicitly closed or when an error occurs.
askari01 and sondrelg