crowdin/mobile-sdk-ios

Switch must be exhaustive in SocketAPI (StarScream 4.0.6 update)

phiilu opened this issue · 3 comments

Describe the bug
StarScream released a new version (4.0.6) where the added a new enum and now the project won't be able to compile.

To Reproduce
Steps to reproduce the behavior:

  1. Use the latest Package versions (Xcode -> File -> Packages -> Update To Latest Package Version)
  2. Try building your project

Expected behavior
The project compiles without errors

Screenshots
image

Smartphone (please complete the following information):

  • Device: iPhone 12
  • OS: 16

Additional context
There is already a Bug ticket on StarScream: daltoniam/Starscream#975

The changed code should be here:

func didReceive(event: WebSocketEvent, client: WebSocket) {
switch event {
case .connected:
isConnected = true
onConnect?()
case .disconnected:
isConnected = false
onDisconnect?()
case .text(let string):
websocketDidReceiveText(string)
case .binary: break
case .ping: break
case .pong: break
case .viabilityChanged: break
//the viability (connection status) of the connection has updated.
// e.g. connection is down, connection came back up https://github.com/daltoniam/Starscream/issues/798
case .reconnectSuggested(let shouldReconnect):
//the connection has upgrade to wifi from cellular. Consider reconnecting to take advantage of this
if shouldReconnect {
reconnect()
}
case .cancelled:
isConnected = false
case .error(let error):

Related PR that fix this: #225

Work in progress in #225

is there a fix yet?