Skip to content

Conversation

@laevandus
Copy link
Contributor

@laevandus laevandus commented Oct 10, 2025

🔗 Issue Links

Resolves: IOS-1192

🎯 Goal

Fix isActive getting set to false in ChatChannelViewModel because presentation mode onChange is triggered with iOS 26.1 (this is only a problem when ChatChannelView is presented with UIKit)

📝 Summary

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

🛠 Implementation

func showChannel() {
        let channelController = client
            .channelController(for: .init(
                type: .messaging,
                id: "B083FE2A-4"
            ))
        let hostingController = UIHostingController(rootView: ChatChannelView(channelController: channelController))
        hostingController.modalPresentationStyle = .fullScreen
        present(UINavigationController(rootViewController: hostingController), animated: true)
    }

🎨 Showcase

🧪 Manual Testing Notes

  1. go into the channel
  2. send a message in another one
  3. slowly swipe back and see there's an unread indicator on the other channel.

☑️ 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 10, 2025 07:29
@github-actions
Copy link

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 marked this pull request as draft October 10, 2025 07:37
@laevandus laevandus changed the title Fix using previous presentation mode value in iOS 26.1 beta Fix ChatChannelView isActive when presented using UIKit on iOS 26.1 beta Oct 10, 2025
@laevandus laevandus force-pushed the fix/ios26-1-beta-compatibility branch from 2721734 to ea262c3 Compare October 10, 2025 07:50
@laevandus laevandus marked this pull request as ready for review October 10, 2025 07:50
Comment on lines -186 to -192
.onChange(of: presentationMode.wrappedValue, perform: { newValue in
if newValue.isPresented == false {
viewModel.onViewDissappear()
} else {
viewModel.setActive()
}
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What happens on iOS 26.1 beta is that onChange gets called with new value being false. On iOS 26.0 and earlier, it does not get called. Moreover, above we use onAppear and onDisappear for updating the isActive state and that already works correctly on both iOS 26 versions. Therefore, the fix is to delete it

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was added because it was not updating when swiping back slowly. Can you test that before merging it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Swiping back slowly seems to work OK 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

The test would be -> go into the channel, send a message in another one, slowly swipe back and see there's an unread indicator on the other channel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to work OK as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, approving

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@testableapple could you please try as well for making sure I did not miss anything here

Copy link
Contributor Author

@laevandus laevandus left a comment

Choose a reason for hiding this comment

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

Ready now

@testableapple testableapple enabled auto-merge (squash) October 17, 2025 17:47
@github-actions
Copy link

Public Interface

- extension PresentationMode: Equatable  
- 
-   public static func ==(lhs: PresentationMode,rhs: PresentationMode)-> Bool

@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChatSwiftUI 9.58 MB 9.57 MB -16 KB 🚀

@sonarqubecloud
Copy link

@Stream-SDK-Bot
Copy link
Collaborator

StreamChatSwiftUI XCSize

Object Diff (bytes)
ChatChannelView.o -1240

@testableapple testableapple merged commit b4f6da8 into develop Oct 17, 2025
11 checks passed
@testableapple testableapple deleted the fix/ios26-1-beta-compatibility branch October 17, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants