[v4] Fix typing events sent on channels without typing capability#4147
Conversation
Default to not sending typing events when the channel is not yet loaded, so events are no longer sent to channels (e.g. livestream) whose own_capabilities lack send-typing-events.
Guard the stopTyping call in ChannelController.createNewMessage behind shouldSendTypingEvents, and add an early-return in TypingEventsSender when no typing session is active (currentUserLastTypingDate is nil). This prevents pointless typing.stop API requests on channels where typing events are disabled (e.g. livestream), which the server rejects with 400.
The test was passing trivially because no channel was loaded, not because the capability guard worked. Now it explicitly sets up a channel with empty ownCapabilities before asserting.
The cherry-pick included test changes for a TypingEventsSender early-return that was not backported to v4.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
SDK Performance
|
SDK Size
|
Public Interface🚀 No changes affecting the public interface. |
StreamChat XCSize
|
|



🔗 Issue Links
IOS-1798
Cherry-pick of #4132 and #4146 to v4.
🎯 Goal
Backport typing event fixes to v4. These prevent
typing.stopandtyping.startAPI requests from being sent on channels where typing events are disabled (e.g. livestream), which causes the server to reject them with 400 errors.📝 Summary
shouldSendTypingEventstofalsewhen channel is not loaded (wastrue)sendKeystrokeEvent,sendStartTypingEvent,sendStopTypingEventbehindshouldSendTypingEvents/canSendTypingEventscapability checkstopTypingcall inChannelController.createNewMessagebehindshouldSendTypingEventsChatstate layer🛠 Implementation
Cherry-picked from develop PRs #4132 and #4146 with minor conflict resolution for v4 API differences (non-Sendable closures).
🧪 Manual Testing Notes
typing.startortyping.stop400 errors in the network logs☑️ Contributor Checklist
docs-contentrepo