Skip to content
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

4.61.0 Release #3344

Merged
merged 25 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e53e461
Fix channel search view by refreshing the view state in both did chan…
laevandus Jul 19, 2024
8a9d94f
Merge branch 'main' into develop
testableapple Jul 19, 2024
dac58ff
Update CHANGELOG.md (#3321)
testableapple Jul 22, 2024
dba171f
[CI] Automate merge to develop on release (#3326)
testableapple Jul 22, 2024
2714853
Remove Carthage from the docs (#3327)
testableapple Jul 22, 2024
0a0682d
Delete unused variable (#3328)
testableapple Jul 23, 2024
5773202
[CI] Print sdk size in PRs (#3329)
testableapple Jul 24, 2024
de9faf4
[CI] Show sdk size update on PR (#3331)
testableapple Jul 24, 2024
e4931b7
Expose MissingConnectionId + InvalidURL + InvalidJSON Errors (#3332)
nuno-vieira Jul 24, 2024
b9d8f85
Resolve test cert issue (#3334)
testableapple Jul 24, 2024
18e72ed
Database container test_databaseContainer_removesAllData_whenShouldFl…
laevandus Jul 25, 2024
13606da
Improve performance of ChatChannel and ChatMessage equality which cau…
laevandus Jul 25, 2024
5ea8062
Improve performance of `ChatChannel` database model conversions ~7 ti…
laevandus Jul 25, 2024
95ee556
Add environment value for injecting logging level for development pur…
laevandus Jul 26, 2024
ead44a7
Fix a rare issue with incorrect message order when sending messages o…
laevandus Jul 29, 2024
69b3382
[CI] Comment SDK size on every commit (#3339)
testableapple Jul 29, 2024
2e1cc9d
[CI] Update SDK size rounding (#3341)
testableapple Jul 29, 2024
b70b2c3
[CI] Also round size diff (#3342)
testableapple Jul 29, 2024
70941fd
[CI] Fix Allure launch issue (#3343)
testableapple Jul 29, 2024
9585540
Add Channel List `.hasUnread` filter (#3340)
nuno-vieira Jul 30, 2024
87cd5fe
Fix PR link in the CHANGELOG
laevandus Jul 30, 2024
571ed7c
Bump 4.61.0
Jul 30, 2024
18a65b4
Fix message search not showing results for new search terms (#3345)
laevandus Jul 30, 2024
e7398f8
[CI] Adjust sdk size report on release PRs (#3346)
testableapple Jul 30, 2024
5e71f8a
[CI] Pass branch name to sdk size report (#3347)
testableapple Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Performance Benchmarks
name: SDK Performance

on:
schedule:
Expand All @@ -16,8 +16,8 @@ env:
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI

jobs:
xcmetrics:
name: XCMetrics
performance:
name: Metrics
runs-on: macos-14
env:
GITHUB_TOKEN: '${{ secrets.CI_BOT_GITHUB_TOKEN }}'
Expand All @@ -39,7 +39,7 @@ jobs:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
INSTALL_GCLOUD: true

- name: Run Performance Metrics
- name: Run XCMetrics
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
run: bundle exec fastlane xcmetrics
timeout-minutes: 120
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/sdk-size-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: SDK Size

on:
pull_request:

workflow_dispatch:

push:
branches:
- develop

env:
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI

jobs:
sdk_size:
name: Metrics
runs-on: macos-14
env:
GITHUB_TOKEN: '${{ secrets.CI_BOT_GITHUB_TOKEN }}'
steps:
- name: Install Bot SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }}

- uses: actions/[email protected]

- uses: ./.github/actions/bootstrap

- name: Get branch name
id: get_branch_name
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT

- name: Run SDK Size Metrics
run: bundle exec fastlane show_frameworks_sizes
timeout-minutes: 30
env:
BRANCH_NAME: ${{ steps.get_branch_name.outputs.branch }}
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
1 change: 1 addition & 0 deletions .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ jobs:
env:
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUM: ${{ github.event.number }}
GITHUB_EVENT: ${{ toJson(github.event) }}
- id: get_launch_id
run: echo "launch_id=${{env.LAUNCH_ID}}" >> $GITHUB_OUTPUT
Expand Down
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ playground.xcworkspace
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/
!Sample/Carthage/

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
Expand All @@ -77,13 +71,12 @@ fastlane/allurectl
fastlane/xcresults
fastlane/recordings
fastlane/performance
fastlane/metrics
StreamChatCore.framework.coverage.txt
StreamChatCoreTests.xctest.coverage.txt
vendor/bundle/
.bundle/
.swiftpm
Example/Carthage/.env
Example/Carthage/fastlane/report.xml
Sample/Cocoapods/Podfile.lock
docusaurus/.env
reports/
Expand Down
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ excluded:
- UISDKdocumentation
- Tests
- TestTools
- Carthage
- Pods
- .build
- spm_cache
- vendor/bundle
- .ruby-lsp
- derived_data

disabled_rules:
- large_tuple
Expand Down
24 changes: 20 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### 🔄 Changed

# [4.61.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.61.0)
_July 30, 2024_

## StreamChat
### ⚡ Performance
- Improve performance of `ChatChannel` database model conversions more than 7 times [#3325](https://github.com/GetStream/stream-chat-swift/pull/3325)
- Improve performance of `ChatChannel` and `ChatMessage` equality checks [#3335](https://github.com/GetStream/stream-chat-swift/pull/3335)
### ✅ Added
- Expose `MissingConnectionId` + `InvalidURL` + `InvalidJSON` Errors [#3332](https://github.com/GetStream/stream-chat-swift/pull/3332)
- Add support for `.hasUnread` filter key to `ChannelListQuery` [#3340](https://github.com/GetStream/stream-chat-swift/pull/3340)
### 🐞 Fixed
- Fix a rare issue with incorrect message order when sending multiple messages while offline [#3316](https://github.com/GetStream/stream-chat-swift/issues/3316)
- Fix sorting channel list by unread count [#3340](https://github.com/GetStream/stream-chat-swift/pull/3340)

## StreamChatUI
### 🐞 Fixed
- Fix message search not showing results for new search terms [#3345](https://github.com/GetStream/stream-chat-swift/pull/3345)

# [4.60.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.60.0)
_July 18, 2024_

Expand All @@ -20,13 +38,11 @@ _July 18, 2024_
- Increase QoS for `Throttler` and `Debouncer` to `utility` [#3297](https://github.com/GetStream/stream-chat-swift/issues/3297)
- Improve reliability of accessing data in controllers' completion handlers [#3305](https://github.com/GetStream/stream-chat-swift/issues/3305)

## StreamChatUI
### 🐞 Fixed
- Fix Channel List not hiding error state view when data is available [#3303](https://github.com/GetStream/stream-chat-swift/pull/3303)

## StreamChatUI
### ✅ Added
- Add support for enabling message list view animations [#3314](https://github.com/GetStream/stream-chat-swift/pull/3314)
### 🐞 Fixed
- Fix Channel List not hiding error state view when data is available [#3303](https://github.com/GetStream/stream-chat-swift/pull/3303)

# [4.59.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.59.0)
_July 10, 2024_
Expand Down
26 changes: 25 additions & 1 deletion DemoApp/StreamChat/Components/DemoChatChannelListVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ final class DemoChatChannelListVC: ChatChannelListVC {
.equal(.hidden, to: true)
]))

lazy var unreadChannelsQuery: ChannelListQuery = .init(filter: .and([
.containMembers(userIds: [currentUserId]),
.hasUnread
]), sort: [.init(key: .unreadCount, isAscending: false)])

lazy var mutedChannelsQuery: ChannelListQuery = .init(filter: .and([
.containMembers(userIds: [currentUserId]),
.equal(.muted, to: true)
Expand Down Expand Up @@ -113,6 +118,15 @@ final class DemoChatChannelListVC: ChatChannelListVC {
}
)

let unreadChannelsAction = UIAlertAction(
title: "Unread Channels",
style: .default,
handler: { [weak self] _ in
self?.title = "Unread Channels"
self?.setUnreadChannelsQuery()
}
)

let coolChannelsAction = UIAlertAction(
title: "Cool Channels",
style: .default,
Expand All @@ -133,7 +147,13 @@ final class DemoChatChannelListVC: ChatChannelListVC {

presentAlert(
title: "Filter Channels",
actions: [defaultChannelsAction, hiddenChannelsAction, mutedChannelsAction, coolChannelsAction],
actions: [
defaultChannelsAction,
unreadChannelsAction,
hiddenChannelsAction,
mutedChannelsAction,
coolChannelsAction
],
preferredStyle: .actionSheet,
sourceView: filterChannelsButton
)
Expand All @@ -143,6 +163,10 @@ final class DemoChatChannelListVC: ChatChannelListVC {
replaceQuery(hiddenChannelsQuery)
}

func setUnreadChannelsQuery() {
replaceQuery(unreadChannelsQuery)
}

func setMutedChannelsQuery() {
replaceQuery(mutedChannelsQuery)
}
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/StreamChat/StreamChatWrapper+DemoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension StreamChatWrapper {
}

// Set the log level
LogConfig.level = .warning
LogConfig.level = StreamRuntimeCheck.logLevel ?? .warning
LogConfig.formatters = [
PrefixLogFormatter(prefixes: [.info: "ℹ️", .debug: "🛠", .warning: "⚠️", .error: "🚨"])
]
Expand Down
6 changes: 6 additions & 0 deletions DemoApp/StreamRuntimeCheck+StreamInternal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ extension StreamRuntimeCheck {
static var isStreamInternalConfiguration: Bool {
ProcessInfo.processInfo.environment["STREAM_DEV"] != nil
}

static var logLevel: LogLevel? {
guard let value = ProcessInfo.processInfo.environment["STREAM_LOG_LEVEL"] else { return nil }
guard let intValue = Int(value) else { return nil }
return LogLevel(rawValue: intValue)
}
}
2 changes: 1 addition & 1 deletion Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is the official iOS SDK for [Stream Chat](https://getstream.io/chat/sdk/ios

* [iOS/Swift Chat Tutorial](https://getstream.io/tutorials/ios-chat/): Learn how to use the SDK by following our simple tutorial.
* [Register](https://getstream.io/chat/trial/): Register to get an API key for Stream Chat.
* [Installation](https://getstream.io/chat/docs/sdk/ios/basics/integration): Learn more about how to install the SDK using CocoaPods, SPM or Carthage.
* [Installation](https://getstream.io/chat/docs/sdk/ios/basics/integration): Learn more about how to install the SDK using SPM or CocoaPods.
* Do you want to use Module Stable XCFrameworks? [Check this out](https://getstream.io/chat/docs/sdk/ios/basics/integration#xcframeworks)
* [Documentation](https://getstream.io/chat/docs/sdk/ios/): An extensive documentation is available to help with you integration.
* [SwiftUI](https://github.com/GetStream/stream-chat-swiftui): Check our SwiftUI SDK if you are developing with SwiftUI.
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<p align="center">
<a href="https://cocoapods.org/pods/StreamChatUI"><img src="https://img.shields.io/badge/CocoaPods-compatible-green" /></a>
<a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-green" /></a>
<a href="https://www.swift.org/package-manager/"><img src="https://img.shields.io/badge/SPM-compatible-green" /></a>
</p>
<p align="center">
Expand All @@ -14,8 +13,8 @@
<a href="https://sonarcloud.io/summary/new_code?id=GetStream_stream-chat-swift"><img src="https://sonarcloud.io/api/project_badges/measure?project=GetStream_stream-chat-swift&metric=coverage" /></a>
</p>
<p align="center">
<img id="stream-chat-label" alt="StreamChat" src="https://img.shields.io/badge/StreamChat-6.7MB-blue"/>
<img id="stream-chat-ui-label" alt="StreamChatUI" src="https://img.shields.io/badge/StreamChatUI-4.4MB-blue"/>
<img id="stream-chat-label" alt="StreamChat" src="https://img.shields.io/badge/StreamChat-6.76MB-blue"/>
<img id="stream-chat-ui-label" alt="StreamChatUI" src="https://img.shields.io/badge/StreamChatUI-4.41MB-blue"/>
</p>

This is the official iOS SDK for [Stream Chat](https://getstream.io/chat/sdk/ios/), a service for building chat and messaging applications. This library includes both a low-level SDK and a set of reusable UI components.
Expand Down Expand Up @@ -49,7 +48,7 @@ The **StreamChatSwiftUI SDK** is our UI SDK for SwiftUI components. If your appl

- [iOS/Swift Chat Tutorial](https://getstream.io/tutorials/ios-chat/): Learn how to use the SDK by following our simple tutorial with UIKit (or [SwiftUI](https://getstream.io/tutorials/swiftui-chat/)).
- [Register](https://getstream.io/chat/trial/): Register to get an API key for Stream Chat.
- [Installation](https://getstream.io/chat/docs/sdk/ios/basics/integration): Learn more about how to install the SDK using CocoaPods, SPM or Carthage.
- [Installation](https://getstream.io/chat/docs/sdk/ios/basics/integration): Learn more about how to install the SDK using SPM or CocoaPods.
- Do you want to use Module Stable XCFrameworks? [Check this out](https://getstream.io/chat/docs/sdk/ios/basics/integration#xcframeworks)
- [Documentation](https://getstream.io/chat/docs/sdk/ios/): An extensive documentation is available to help with you integration.
- [SwiftUI](https://github.com/GetStream/stream-chat-swiftui): Check our SwiftUI SDK if you are developing with SwiftUI.
Expand Down
19 changes: 0 additions & 19 deletions Scripts/carthage.sh

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/StreamChat/APIClient/RequestEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ protocol ConnectionDetailsProviderDelegate: AnyObject {
func provideToken(timeout: TimeInterval, completion: @escaping (Result<Token, Error>) -> Void)
}

extension ClientError {
public extension ClientError {
final class InvalidURL: ClientError {}
final class InvalidJSON: ClientError {}
final class MissingConnectionId: ClientError {}
Expand Down
16 changes: 16 additions & 0 deletions Sources/StreamChat/ChatClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ extension ChatClient: ConnectionStateDelegate {
}
)
connectionRecoveryHandler?.webSocketClient(client, didUpdateConnectionState: state)
try? backgroundWorker(of: MessageSender.self).didUpdateConnectionState(state)
}
}

Expand All @@ -674,6 +675,21 @@ extension ChatClient: ConnectionDetailsProviderDelegate {
}
}

extension ChatClient {
func backgroundWorker<T>(of type: T.Type) throws -> T {
if let worker = backgroundWorkers.compactMap({ $0 as? T }).first {
return worker
}
if currentUserId == nil {
throw ClientError.CurrentUserDoesNotExist()
}
if !config.isClientInActiveMode {
throw ClientError.ClientIsNotInActiveMode()
}
throw ClientError("Background worker of type \(T.self) is not set up")
}
}

extension ClientError {
public final class MissingLocalStorageURL: ClientError {
override public var localizedDescription: String { "The URL provided in ChatClientConfig is `nil`." }
Expand Down
Loading
Loading