Skip to content

[v4] Fix typing events sent on channels without typing capability#4147

Merged
nuno-vieira merged 7 commits into
v4from
fix/typing-events-v4
Jun 26, 2026
Merged

[v4] Fix typing events sent on channels without typing capability#4147
nuno-vieira merged 7 commits into
v4from
fix/typing-events-v4

Conversation

@nuno-vieira

@nuno-vieira nuno-vieira commented Jun 26, 2026

Copy link
Copy Markdown
Member

🔗 Issue Links

IOS-1798

Cherry-pick of #4132 and #4146 to v4.

🎯 Goal

Backport typing event fixes to v4. These prevent typing.stop and typing.start API 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

  • Default shouldSendTypingEvents to false when channel is not loaded (was true)
  • Guard sendKeystrokeEvent, sendStartTypingEvent, sendStopTypingEvent behind shouldSendTypingEvents / canSendTypingEvents capability check
  • Guard the stopTyping call in ChannelController.createNewMessage behind shouldSendTypingEvents
  • Same guards added to the Chat state layer

🛠 Implementation

Cherry-picked from develop PRs #4132 and #4146 with minor conflict resolution for v4 API differences (non-Sendable closures).

🧪 Manual Testing Notes

  1. Create a livestream channel type with typing events disabled
  2. Send a message / type in that channel
  3. Verify no typing.start or typing.stop 400 errors in the network logs

☑️ 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 and others added 5 commits June 26, 2026 14:48
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.
@nuno-vieira nuno-vieira requested a review from a team as a code owner June 26, 2026 13:52
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

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.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eefecc14-afdd-409a-bec0-b0e855fa2706

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/typing-events-v4

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.

Comment thread CHANGELOG.md Outdated
@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

SDK Performance

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 6.68 ms 33.2% 🔼 🟢
Duration 2.6 s 2.55 s 1.92% 🔼 🟢
Hitch time ratio 4 ms per s 2.62 ms per s 34.5% 🔼 🟢
Frame rate 75 fps 78.94 fps 5.25% 🔼 🟢
Number of hitches 1 0.8 20.0% 🔼 🟢

@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

SDK Size

title v4 branch diff status
StreamChat 8.69 MB 8.69 MB 0 KB 🟢
StreamChatUI 4.94 MB 4.94 MB 0 KB 🟢

@github-actions

Copy link
Copy Markdown

Public Interface

🚀 No changes affecting the public interface.

@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

StreamChat XCSize

Object Diff (bytes)
Chat.o +2292
ChannelController.o +1748
LivestreamChannelController.o -56

@sonarqubecloud

Copy link
Copy Markdown

@nuno-vieira nuno-vieira merged commit 1bfbab5 into v4 Jun 26, 2026
19 checks passed
@nuno-vieira nuno-vieira deleted the fix/typing-events-v4 branch June 26, 2026 16:20
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.

4 participants