Skip to content

4.0.0-beta.5

Pre-release
Pre-release
Compare
Choose a tag to compare
@b-onc b-onc released this 08 Jul 07:45
· 1426 commits to main since this release

⚠️ Breaking Changes from 4.0-beta.4

The severity of changes: 🟠 medium

  • The CreateChatChannelButton component was removed. The component acted only as a placeholder and the functionality should be always provided by the hosting app. For an example implementation see the Demo app.

  • The payload of AnyChatMessageAttachment changed from Any to Data #1248.

  • The user setting API was updated. It's now required to call one of the available connect methods on ChatClient after ChatClient's instance is created in order to establish connection and set the current user.

    Migration tips:

    If you were doing:

    let client = ChatClient(config: config, tokenProvider: .static(token))

    Now you should do:

    let client = ChatClient(config: config)
    client.connectUser(userInfo: .init(id: userId), token: token)

    Guest users before:

    let client = ChatClient(
      config: config,
      tokenProvider: .guest(
        userId: userId,
        name: userName
      )
    )

    Now you should do:

    let client = ChatClient(config: config)
    client.connectGuestUser(userInfo: .init(id: userId))

    Anonymous users before:

    let client = ChatClient(config: config, tokenProvider: .anonymous)

    Now you should do:

    let client = ChatClient(config: config)
    client.connectAnonymousUser()

    If you use tokens that expire you probably do something like this:

    let client = ChatClient(
      config: config,
      tokenProvider: .closure { client, completion in
        service.fetchToken { token in
          completion(token)
        }
      }
    )

    Now you should do:

    let client = ChatClient(config: config)
    service.fetchToken { token in
      client.connectUser(userInfo: .init(id: userId), token: token)
    }
    // `tokenProvider` property is used to reobtain a new token in case if the current one is expired
    client.tokenProvider = { completion in
      service.fetchToken { token in
        completion(token)
      }
    }

✅ Added

  • search(query:) function to UserSearchController to make a custom search with a query #1206
  • queryForMentionSuggestionsSearch(typingMention:) function to ComposerVC, users can override this function to customize mention search behavior #1206
  • .contains added to Filter to be able to filter for teams #1206

🔄 Changed

  • shouldConnectAutomatically setting in ChatConfig, it now has no effect and all logic that used it now behaves like it was set to true.

🐞 Fixed

  • ConnectionController fires its controllerDidChangeConnectionStatus method only when the connection status actually changes #1207
  • Fix cancelled ephemeral (giphy) messages and deleted messages are visible in threads #1238
  • Fix crash on missing cid value of Message during local cache invalidation #1245
  • Messages keep correct order if the local device time is different from the server time #1246