Skip to content

Conversation

@laevandus
Copy link
Contributor

@laevandus laevandus commented Oct 29, 2025

🔗 Issue Links

Fixes IOS-1206

🎯 Goal

Describe why we are making this change.

📝 Summary

Provide bullet points with the most important changes in the codebase.

🛠 Implementation

Provide a detailed description of the implementation and explain your decisions if you find them relevant.

🎨 Showcase

Add relevant screenshots and/or videos/gifs to easily see what this PR changes, if applicable.

Before After
img img

🧪 Manual Testing Notes

Explain how this change can be tested manually, if applicable.

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@laevandus laevandus requested a review from a team as a code owner October 29, 2025 11:14
@coderabbitai
Copy link

coderabbitai bot commented Oct 29, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch v5-concurrency-and-timers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@laevandus laevandus force-pushed the v5-concurrency-and-timers branch from 6969561 to e67de7f Compare October 29, 2025 11:16
@Stream-SDK-Bot
Copy link
Collaborator

SDK Performance

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 1.67 ms 83.3% 🔼 🟢
Duration 2.6 s 2.56 s 1.54% 🔼 🟢
Hitch time ratio 4 ms per s 0.65 ms per s 83.75% 🔼 🟢
Frame rate 75 fps 78.13 fps 4.17% 🔼 🟢
Number of hitches 1 0.2 80.0% 🔼 🟢

@github-actions
Copy link

1 Warning
⚠️ Big PR
1 Message
📖 There seems to be app changes but CHANGELOG wasn't modified.
Please include an entry if the PR includes user-facing changes.
You can find it at CHANGELOG.md.

Generated by 🚫 Danger

@laevandus laevandus changed the title Use concurrency and timers from StreamCore V5: Use concurrency and timers from StreamCore Oct 29, 2025
@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChat 8.26 MB 7.69 MB -583 KB 🚀
StreamChatUI 4.89 MB 5.05 MB +161 KB 🟢

@Stream-SDK-Bot
Copy link
Collaborator

StreamChat XCSize

Object Diff (bytes)
Logger.o -150466
CDNClient.o -76916
MessageController.o -63002
ChannelController.o -55252
RequestEncoder.o +30647
Show 215 more objects
Object Diff (bytes)
UserListController.o -24462
Chat.o -21787
MessageEvents.o +18460
CurrentUserController.o -18355
RawJSON.o -11025
MessageReactionDTO.o -9617
NotificationEvents.o +9426
BaseLogDestination.o -8832
MemberController.o -8472
ChannelRepository.o -8019
UserController.o -7668
MessageSearchQuery.o -7108
ThreadEvents.o +6648
Timers.o -6207
StreamCollection.o -5968
ChannelEvents.o +5896
LazyCachedMapCollection.o -5419
ReminderPayloads.o -5295
OfflineRequestsRepository.o -5196
ChannelListController.o -4706
ChannelWatcherHandler.o -4693
ChannelListLinker.o -4525
LogDestination.o -4329
ChannelList.o -3915
PollController.o -3882
ChatClient+Environment.o +3658
MessageReminder.o +3572
AppSettings.o -3492
Thread.o +3420
ThreadListController.o -3354
ChatChannelWatcherListController.o -3265
MessageRepository.o -2960
UserSearchController.o -2890
Channel.o +2788
MessageReminderListController.o -2771
MessagePayloads.o +2661
LivestreamChannelController.o +2487
ChatState.o -2414
AudioPlaying.o +2341
Atomic.o -2305
MessageSearchController.o +2197
SyncOperations.o -2130
AudioRecording.o -2102
ThreadDTO.o -1945
Deprecations.o -1884
ChannelEventsController.o -1880
ChannelDTO.o -1813
ReadStateHandler.o +1740
PollVoteListController.o -1708
ReactionListController.o -1679
MulticastDelegate.o -1668
ConnectionRecoveryHandler.o -1647
APIClient.o -1611
DataController.o -1514
SyncRepository.o -1500
ConnectionController.o -1416
UserSearchState.o -1407
PollVoteListController+SwiftUI.o -1406
UserListQuery.o -1396
ChannelUpdater.o -1345
MessageReminderListQuery.o -1336
ConsoleLogDestination.o -1304
UnreadMessageLookup.o -1292
UserUpdater.o -1231
ChannelListQuery.o -1210
PollDTO.o +1157
ChatState+Observer.o -1127
MemberListState+Observer.o -1017
ReactionListState+Observer.o -1006
BackgroundTaskScheduler.o -981
UserListState+Observer.o -958
SendMessageInterceptor.o +928
MessageState+Observer.o -921
ReactionEvents.o +920
PrefixLogFormatter.o -917
ChatMessageImageAttachment.o -900
UserDTO.o -887
SystemEnvironment+XStreamClient.o +871
MessageEditor.o +868
ChannelListState.o +861
TypingEventsSender.o -852
ConnectedUser.o -830
AnyAttachmentPayload.o +818
ConnectedUserState.o -807
MemberModelDTO.o -765
ChatClientConfig.o -751
ConnectedUserState+Observer.o +749
InternetConnection.o -746
StreamCore_-14BA7DE23376E301_PackageProduct +732
ReactionListUpdater.o -696
ConnectionRepository.o +694
ChannelListState+Observer.o +688
MessageController+SwiftUI.o -666
ChannelReadUpdaterMiddleware.o -652
WebSocketClient.o -651
AnyAttachmentUpdater.o -650
ChannelEditDetailPayload.o +648
MemberListController.o -608
ChannelController+SwiftUI.o -582
DraftMessage.o -572
ChannelListQueryDTO.o -557
MessageSearchState.o -528
PollVoteDTO.o -517
ChannelMemberListQuery.o -492
ReminderUpdaterMiddleware.o -492
Filter+predicate.o -488
PollVoteListQueryDTO.o -485
MessageState.o -466
AttachmentDTO.o -461
MessagePayload+asModel.o -458
MemberEventMiddleware.o -452
TypingStartCleanupMiddleware.o -452
StateBuilder.o -442
Token.o -424
MessageDTO.o +415
Filter.o +411
PollVoteListQuery.o -408
PushPreferenceLevel.o -404
MessageSearchState+Observer.o -382
MessageSearchQueryDTO.o -372
UserWatchingEventMiddleware.o -372
ListChange.o -365
MessageUpdater.o -363
ChannelListSortingKey.o -362
EventsController.o -362
MessageSearch.o -358
ErrorPayload.o -356
RemindersRepository.o -352
AudioQueuePlayer.o +350
BackgroundDatabaseObserver.o -340
ChatClient+Factory.o +340
Controller.o +332
DatabaseSession.o -324
MessageAttachmentPayload.o -324
ChatMessageGiphyAttachment.o -320
ReactionListQueryDTO.o -313
EventDataProcessorMiddleware.o -300
ChannelMemberListSortingKey.o -300
CurrentUserDTO.o -277
MessageReminderDTO.o -276
CurrentUserUpdater.o -269
AITypingEvents.o -256
MessageSender.o -255
PollsRepository.o +252
ChatRemoteNotificationHandler.o -247
MemberEvents.o -244
UserListUpdater.o -239
EventType.o -238
EventNotificationCenter.o -227
UserController+SwiftUI.o -224
MessageTranslationsPayload.o -220
ChannelVisibilityEventMiddleware.o -216
RequestDecoder.o +216
PollOptionDTO.o -213
UserUpdateMiddleware.o -212
DraftUpdaterMiddleware.o -212
URLSessionWebSocketEngine.o -212
ChannelMemberListUpdater.o -211
PushPreferenceDTO.o -208
UserChannelBanEventsMiddleware.o -208
UserListSortingKey.o -208
AsyncOperation.o +206
ChannelListUpdater.o -206
NSManagedObject+Extensions.o -206
UserPayloads.o -204
ChannelTruncatedEventMiddleware.o -200
ChannelMemberListQueryDTO.o -198
ReactionListState.o -193
MemberListController+SwiftUI.o -192
UserListController+SwiftUI.o -191
ReactionListController+SwiftUI.o -191
ScheduledStreamTimer.o +182
ChannelListController+SwiftUI.o -178
ChatClient.o -176
ThreadParticipantDTO.o +176
ReminderEvents.o -172
OptionalDecodable.o -169
ActiveLiveLocationsEndTimeTracker.o -158
AttachmentQueueUploader.o -144
MemberList.o +142
UserEvents.o -140
ConnectionEvents.o -134
ReactionList.o -128
ChatClientFactory.o -128
MemberListState.o -121
EventBatcher.o +110
UserList.o -109
ChatMessage.o -108
Sequence+CompactMapLoggingError.o -108
LogFormatter.o -103
UserListQueryDTO.o -101
DeviceDTO.o -96
ChannelReadDTO.o -93
ChatClient+ChannelController.o -93
GuestUserTokenPayload.o -92
DatabaseContainer.o -90
DraftMessagesRepository.o -86
ChatMessageVideoAttachment.o -82
AttachmentTypes.o -82
BackgroundEntityDatabaseObserver.o +79
ChannelType.o -78
ChannelMuteDTO.o -77
UnreadCount.o -70
ChannelId.o -70
KeyedDecodingContainer+Array.o -68
MessageSearchController+SwiftUI.o +68
StringInterpolation+Extensions.o -64
AttachmentUploader.o -64
Foundation.tbd -60
ThreadReadDTO.o +60
DraftEvents.o -60
EventPayload.o -56
CountdownTracker.o +48
AttachmentDownloader.o +46
StreamRuntimeCheck.o -43

@Stream-SDK-Bot
Copy link
Collaborator

StreamChatUI XCSize

Object Diff (bytes)
Task.o -17474
TaskFetchOriginalData.o +15391
AsyncTask.o +14463
ImageCache.o -12301
TaskLoadImage.o -11844
Show 292 more objects
Object Diff (bytes)
ImageDecoding.o -11502
TaskFetchOriginalImageData.o -9455
ChatChannelListItemView.o +8351
ImageTask.o +8277
ImageDecoders+Default.o +6986
Deprecations.o -6872
TaskFetchOriginalImage.o +6305
ImagePipeline+Cache.o +5951
TaskFetchDecodedImage.o -5912
Cache.o +5753
FetchImage.o -5172
ImageLoadingOptions.o +5159
ImagePipelineConfiguration.o -5123
ImageRequest.o +5123
AssetType.o +5065
ImagePipeline+Configuration.o +5037
InputChatMessageView.o +5016
ImagePipeline+Error.o +4837
DataLoader.o +4829
ChatThreadListItemView.o +4694
ImageProcessing.o -4663
ChatMessageDeliveryStatusView.o +4560
AttachmentsPreviewVC.o +4506
ImageViewExtensions.o -4446
ImageProcessors+Resize.o +4429
TaskLoadData.o +4282
ImageResponse.o -4234
ComposerVC.o +4018
QuotedChatMessageView.o +3955
ImagePipeline.o -3950
OperationTask.o -3614
ChatMessageHeaderDecoratorView.o +3550
ImagePipelineDelegate.o -3523
Graphics.o +3309
ImageContainer.o +3232
ChatMessageListVC.o +3229
ImageCaching.o +3205
TaskFetchWithPublisher.o +3062
ImagePipelineCache.o -3055
NSCacheWrapper.o +2929
MessageActionsTransitionController.o +2916
GalleryVC.o +2645
ImageDecoderRegistry.o +2445
AsyncPipelineTask.o +2431
ImagePipelineTask.o -2399
ImageLoading.o -2146
Combine.o -2095
String+Extensions.o -1956
ImageEncoding.o -1865
VideoPlaybackControlView.o +1860
NukeImageLoader.o +1856
ChatMessageReactionsPickerVC.o +1832
ChatMessageReactionAuthorsFlowLayout.o +1819
ChatChannelVC.o +1693
ChatChannelAvatarView.o +1633
Appearance+Images.o -1632
ImageEncoders+ImageIO.o +1627
PollResultsVC.o +1568
VideoAttachmentGalleryPreview.o +1531
StatefulScrollViewPaginationHandler.o +1511
DataPublisher.o +1491
InputTextView.o +1471
Deprecated.o -1409
ContainerStackView.o +1389
SwipeToReplyGestureHandler.o +1386
PollCreationVC.o +1372
StreamModalTransitioningDelegate.o +1364
ChatChannelListVC.o +1288
ImageRequestKeys.o +1264
PollAttachmentView.o +1254
VideoAttachmentGalleryCell.o +1230
ChatMessageVoiceRecordingAttachmentListView+ItemView.o +1174
ImageProcessingOptions.o +1152
ComposerView.o +1076
ZoomAnimator.o +1058
ViewContainerBuilder.o +1024
ChatThreadListVC.o +972
ChatSuggestionsVC.o +956
ChatMessageAttachmentPreviewVC.o +950
SwipeableView.o +945
ChatMessageReactionAuthorsVC.o +928
ImagePipeline+Delegate.o +925
ImagePublisher.o +907
UploadingOverlayView.o +884
ChatChannelHeaderView.o +883
PollAttachmentOptionListView.o +870
ChatReactionsBubbleView.o +847
ChatMessageInteractiveAttachmentView.o +828
ChatMessageListScrollOverlayView.o +828
Atomic.o +820
ChatMessageListView.o +813
VideoLoading.o -813
Extensions.o +796
UIImageView+SwiftyGif.o +787
ListCollectionViewLayout.o +783
ImageEncoders+Default.o +781
ChatChannelListErrorView.o +764
PollCommentListSectionFooterView.o +756
AlertsRouter.o +754
ChatMessageCell.o +745
GalleryCollectionViewCell.o +745
ChatChannelListCollectionViewCell.o +721
ChatChannelSearchVC.o +696
UIView+Extensions.o +693
PollCreationMultipleVotesFeatureCell.o +692
BaseViews.o +676
BannerView.o +670
ChatMessageImageGallery+ImagePreview.o +668
ChatMessageGalleryView.o +666
ChatMessageInteractiveAttachmentView+ActionButton.o +645
CheckboxControl.o +611
ChatMessageListRouter.o +610
BidirectionalPanGestureRecogniser.o +605
CurrentChatUserAvatarView.o +601
DifferenceKit+Stream.o +600
ChatMessageReactionItemView.o +599
ChatMessageActionControl.o +597
MediaButton.o +591
FileAttachmentView.o +586
ChatChannelListLoadingView.o +583
ResumableData.o +574
PollCreationSectionHeaderView.o +565
ChatMessageDeliveryStatusCheckmarkView.o +558
PollCreationOptionCell.o +550
StackedUserAvatarsView.o +546
ChatMessage+Extensions.o -536
ScrollViewPaginationHandler.o +535
ImageResize.o -532
PollCreationTextFieldView.o +529
ChatMessageFileAttachmentListView.o +529
ChatReactionPickerBubbleView.o +524
ChatAvatarView.o +510
ChatThreadListItemCell.o +506
CommandLabelView.o +500
ZoomDismissalInteractionController.o +494
ZoomTransitionController.o +488
ChatMessageVoiceRecordingAttachmentListView.o +487
ChatThreadArrowView.o +483
ChatChannelListLoadingViewCellContentView.o +477
GradientView.o +476
ChatLoadingIndicator.o +476
ClampedView.o +475
PollAttachmentOptionListItemView.o +472
VoiceRecordingAttachmentComposerPreview.o +471
SendButton.o +470
ChatChannelUnreadCountView+SwiftUI.o +470
CooldownView.o +468
ChatChannelListItemView+SwiftUI.o +467
CloseButton.o +467
ShareButton.o +467
ChatMessageContentView+SwiftUI.o +466
ChatChannelAvatarView+SwiftUI.o +465
QuotedChatMessageView+SwiftUI.o +465
AudioVisualizationView.o +458
MixedAttachmentViewInjector.o +455
ChatMessageDefaultReactionsBubbleView.o +453
ChatChannelListEmptyView.o +452
ComposerLinkPreviewView.o +451
ChatChannelListSearchVC.o +450
ChatMentionSuggestionView.o +449
ChatMessageLinkPreviewView.o +446
LockIndicatorView.o +445
CellActionView.o +442
ChatFileAttachmentListView+ItemView.o +439
ChatMessageActionsVC.o +432
NavigationVC.o +428
NSLayoutConstraint+Extensions.o +425
ChatMessageVoiceRecordingAttachmentListView+ItemViewPresenter.o +425
LiveRecordingView.o +409
ImagePrefetcher.o +405
ChatMessagePopupVC.o +402
ChatMessageGiphyView+GiphyBadge.o +399
ChatMessageListDateSeparatorView.o +396
Components.o -395
PlayPauseButton.o +395
PollResultsTableHeaderView.o +394
PollCreationFeatureSwitchView.o +393
PollCreationNameCell.o +392
JumpToUnreadMessagesButton.o +390
ChatPresenceAvatarView.o +386
ScrollToBottomButton.o +384
ChatSuggestionsCollectionViewLayout.o +379
OnlyLinkTappableTextView.o +376
ImageAttachmentGalleryCell.o +374
TextFieldView.o +373
ChatMentionSuggestionCollectionViewCell.o +371
AttachmentPreviewContainer.o +370
VoiceRecordingAttachmentQuotedPreview.o +369
ChatThreadUnreadCountView.o +365
PillButton.o +362
VideoAttachmentComposerPreview.o +362
ChatChannelListLoadingViewCell.o +358
PlayerView.o +358
RecordButton.o +356
UIImage+SwiftyGif.o +356
ChatSuggestionsCollectionView.o +353
Appearance+Formatters.o -352
OnlineIndicatorView.o +351
AttachmentActionButton.o +350
BadgeView.o +349
ChatMessageReactionsView.o +347
ChatMessageLayoutOptions.o -340
TypingAnimationView.o +339
ChatThreadHeaderView.o +336
ChatMessageGiphyView.o +332
PollAllOptionsListVC.o +324
DefaultAttachmentPreviewProvider.o +316
PollAllOptionsListItemCell.o +314
DefaultScrollViewKeyboardHandler.o +312
NavigationRouter.o +296
ImageResultsMapper.o -292
ComposerKeyboardHandler.o +291
PollCreationFeatureCell.o +291
ChatMessageReactionAuthorViewCell.o +289
ChatCommandSuggestionView.o +289
PollResultsSectionFooterView.o +288
PollCommentListVC.o +288
PollResultsVoteItemView.o +287
ChatThreadListEmptyView.o +287
RecordingIndicatorView.o +286
ChatChannelUnreadCountView.o +286
TypingIndicatorView.o +283
TitleContainerView.o +282
SlideToCancelView.o +281
WaveformView.o +276
ChatCommandSuggestionCollectionViewCell.o +275
ChatSuggestionsCollectionReusableView.o +273
ChatUnreadMessagesCountDecorationView.o +273
ChatThreadRepliesCountDecorationView.o +272
ImageDecompression.o +272
ChatReactionPickerReactionsView.o +267
ChatMessagesCountDecorationView.o +267
ChatThreadListHeaderBannerView.o +266
ChatMessageListUnreadCountView.o +266
ChatMessageErrorIndicator.o +261
ChatSuggestionsHeaderView.o +261
ChatThreadListLoadingView.o +261
ChatMessageDecorationView.o +261
ChatThreadListErrorView.o +259
PollCommentListItemView.o +259
ChatMessageBubbleView.o +257
CircularCloseButton.o +255
ShrinkInputButton.o +253
CellSeparatorView.o +253
ChatNavigationBar.o +253
AttachmentButton.o +252
RecordingTipView.o +252
CheckboxButton.o +250
CommandButton.o +249
ConfirmButton.o +249
StreamCDN.o +248
PollCommentListItemCell.o +247
PollResultsVoteItemCell.o +247
ChatThreadVC.o -243
GalleryAttachmentViewInjector.o +237
LinkedList.o +232
ChatUserAvatarView.o +222
Operation.o +194
UnsupportedAttachmentViewInjector.o -191
PollResultsSectionHeaderView.o +180
ImageAttachmentComposerPreview.o +178
PollResultsVoteListVC.o +172
ChatChannelListCollectionViewDelegate.o +169
ChatMessageContentView.o +163
LinkAttachmentViewInjector.o +162
StreamChat.tbd -160
FileAttachmentViewInjector.o +158
PollCommentListSectionHeaderView.o +156
UIStackView+Extensions.o +154
ChatMessageLayoutOptionsResolver.o -151
MarkdownFormatter.o -142
Log.o -140
DataCaching.o +136
StreamCore_-14BA7DE23376E301_PackageProduct +136
SwiftyGifManager.o -124
DataLoading.o +104
VoiceRecordingVC.o +102
Appearance.o +94
ChatMessageReactions+Types.o -92
ImageIO.tbd +92
ChatChannelListRouter.o -74
AnyDifferentiable.o +72
StagedChangeset.o +72
ImageProcessors.o +67
ImageEncoders.o +65
Calendar+StreamCalendar.o +64
L10n.o +60
PollAttachmentViewInjector.o +56
NukeImageProcessor.o -49
ChatMessageListVCDelegate.o -48
ElementPath.o -44
ImageLoaderOptions.o +42

@github-actions
Copy link

Public Interface

- @propertyWrapper public class Atomic: @unchecked Sendable  
- 
-   public var wrappedValue: T
-   
- 
-   public init(wrappedValue: T)
-   
- 
-   public func mutate(_ changes: (_ value: inout T) -> Void)
-   public func callAsFunction(_ changes: (_ value: inout T) -> Void)

@sonarqubecloud
Copy link

}

func eventsController(_ controller: EventsController, didReceiveEvent event: any Event) {
func eventsController(_ controller: EventsController, didReceiveEvent event: any StreamChat.Event) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't be cleaned up in this PR because there are multiple Event types. Cleaned it up in the last websocket PR


import Foundation

enum StreamConcurrency {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably move the Debouncer and Throttler to StreamCore too right? 🤔

Copy link
Member

@nuno-vieira nuno-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants