Repository navigation
fix(SampleApp): start new conversations the way the UI cookbook does - #3953
Merged
Merged
Conversation
The new-conversation screen now creates its channel in a `sendMessageRequest` handler on the first send, as the "Starting a conversation" UI cookbook does, instead of a custom send button that called the raw API and replaced the screen. The screen stays open after the first send, and the channel header replaces the recipient picker once the conversation exists.
Contributor
SDK Size
|
Merged
1 of 6 tasks
oliverlaz
approved these changes
Nov 9, 2026
isekovanic
added a commit
that referenced
this pull request
Nov 9, 2026
…expo-av is installed (#3954) Ticket: https://linear.app/stream/issue/REACT-1538 Stacked on #3953. ## 🎯 Goal Stop `stream-chat-expo` from logging "install the expo-av package" in apps that have `expo-audio` installed. Audio works in those apps, so the log is wrong, and it points to a package Expo has deprecated. ## 🛠 Implementation details `AudioVideo.ts` logged whenever `require('expo-av')` failed, without checking for `expo-audio`. `Audio.ts` and `Sound.ts` use `expo-audio` first and fall back to `expo-av` only when it's missing. - The log is removed from `AudioVideo.ts`. - `Sound.ts` already loads both packages, so it now logs once, only when neither is installed, and names `expo-audio`, for playback and voice recording. The `expo-av` fallback stays. `stream-chat-expo` v10 supports Expo 53 and 54, where `expo-av` still works, so an app that never moved to `expo-audio` keeps its audio without a log. The same log has been on `develop` since v7, so this isn't a v10 regression. ## 🎨 UI Changes None. ## 🧪 Testing - New `Sound.test.ts`, with the optional packages mocked. With only `expo-audio` installed there's no log, with only `expo-av` there's no log, and with neither there's one log naming `expo-audio`. Without the fix, the first and third cases fail. - The expo-package typecheck, `yarn test:typecheck`, `prettier` and `yarn lint` pass. ## ☑️ Checklist - [x] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
Contributor
|
🎉 This PR is included in version 10.0.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: https://linear.app/stream/issue/REACT-1537
🎯 Goal
Make the SampleApp start new conversations the way the v10 "Starting a conversation" UI cookbook does, so the sample exercises the path integrators follow.
It also bumps
stream-chatto 10.0.1, which has the fix for the first-message error (GetStream/stream-chat-js#2007).39a2be3b0caec3a002stream-chatbumped to 10.0.1Its new-conversation screen had a custom send button that composed the message, called
channel.watch()and the rawchannel.sendMessage(), then replaced the screen withChannelScreen. The message never showed as sending, and the cookbook's flow was never run in the sample, which is how the first-message error fixed in GetStream/stream-chat-js#2007 went unnoticed.🛠 Implementation details
utils/startConversation.tsholds the cookbook's two helpers.startLocalConversation()gets the channel from its members and places an empty first page while it's provisional, so the list shows its empty state.createOnFirstSend()is asendMessageRequesthandler: for a provisional channel it callsChannel.watch(), which creates the channel, and sends on the instancewatch()resolves with. Every other channel sends through the default request.useChatClientregisters the handler in its existingclient.config.set()call, where the client is created.NewDirectMessagingScreenbuilds its draft withstartLocalConversation(), uses the defaultMessageComposer, and passesoverrideOwnCapabilities(sendMessageandsendLinks) only while the channel is provisional. It stays open after the first send, and<Channel>moves to the created channel, or to the one that superseded it.NewConversationHeaderreplaces the recipient picker with the channel header. An existing conversation keeps the picker, so its recipients can still be changed.ChannelHeaderis exported fromChannelScreenwith two optional props:onBack, so the new-conversation screen still resets its user search on back, andinSafeArea, since that screen already applies the top inset.ChannelScreenpasses neither and is unchanged.NewDirectMessagingSendButtonis removed.The other example apps don't start conversations from members (ExpoChatGPTSample creates its channels with an id), so they need no change.
stream-chatgoes from^10.0.0to^10.0.1in the SDK and every example app, as in #3951. 10.0.1 is 10.0.0 plus GetStream/stream-chat-js#2007: the first message in a channel whose newest page was loaded empty now starts the newest interval, sojumpToTheLatestMessage()no longer fails right after the first send of a new conversation.🎨 UI Changes
The new-conversation screen keeps the conversation open after the first message and swaps the recipient picker for the channel header. Before, it navigated to
ChannelScreen.🧪 Testing
Tested in SampleApp on iOS (debug build, iPhone 17 Pro simulator), starting new conversations with throwaway users. Each first send went through the superseded-channel path from the cookbook report.
stream-chat10.0.0-rc.34, a new direct conversation sends from the same screen, andstream-chatemitsapi:message:jumpToLatest:failed, the error the cookbook report describes.ChannelScreen's header is unchanged.yarn test:typecheck, SampleApptscandyarn lintpass.☑️ Checklist
developbranch