Skip to content

Conversation

@Rohit3523
Copy link
Contributor

@Rohit3523 Rohit3523 commented Jan 7, 2026

Proposed changes

Previously, typing events did not include the thread ID in the user activity, which caused the typing indicator to appear in the parent room instead of the thread on web clients. By passing the tmid, the typing status is now correctly scoped to the active thread, ensuring the indicator is displayed in the thread view and aligning the behavior with the expected user experience.

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-1644

How to test or reproduce

Screenshots

Screen.Recording.2026-01-07.at.10.30.01.PM.mov

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features
    • Typing indicators now support threaded conversations, allowing users to see real-time notifications when team members are typing within specific discussion threads. This enhancement provides clearer context and improved visibility during collaborative work across different conversation topics.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

Walkthrough

The pull request extends the typing notification system to support thread context. A new IUserTypingArgs type with optional tmid field is introduced, the userTyping action is updated to include this optional argument, and the typing event propagates thread ID through the action layer, UI component, service layer, and saga middleware.

Changes

Cohort / File(s) Summary
Action & Type Definitions
app/actions/room.ts
Adds IUserTypingArgs type with optional tmid field; extends IUserTyping interface to include optional args property; updates userTyping function signature to accept optional args parameter and include it in the returned action payload
UI Event Emission
app/containers/MessageComposer/components/ComposerInput.tsx
Modified to pass thread message ID via third argument { tmid } to userTyping when composing a thread message
Service Layer
app/lib/services/restApi.ts
Extended emitTyping function signature to accept optional args parameter with tmid field; passes args to sdk.methodCall for server versions ≥ 4.0.0
Saga Middleware
app/sagas/room.js
Updated watchUserTyping saga to accept and forward args parameter to emitTyping

Sequence Diagram

sequenceDiagram
    participant UI as ComposerInput
    participant Action as userTyping Action
    participant Saga as watchUserTyping Saga
    participant Service as emitTyping Service
    participant SDK as Rocket.Chat SDK

    UI->>Action: userTyping(rid, status, {tmid})
    activate Action
    Action->>Action: Create IUserTyping with args
    deactivate Action
    
    Saga->>Saga: Intercept IUserTyping action
    Note over Saga: Extract args from action
    
    Saga->>Service: emitTyping(room, typing, args)
    activate Service
    alt Server version >= 4.0.0
        Service->>SDK: methodCall('stream-notify-room', ..., ['user-typing'], args)
        Note over SDK: Includes thread context
    else Server version < 4.0.0
        Service->>SDK: methodCall('stream-notify-room', ...)
    end
    deactivate Service
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Through actions and sagas, the thread context flows,
From composer to SDK, our typing now knows,
When messages dance in their threaded retreat,
We type in the thread—what a feat, what a feat! ✨🧵

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: passing tmid (thread message ID) to display typing status in threads, which aligns with the changeset's core objective across all modified files.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch thread-typing

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.

@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build January 7, 2026 18:46 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build January 7, 2026 18:46 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_android_build January 7, 2026 18:46 — with GitHub Actions Error
@Rohit3523 Rohit3523 self-assigned this Jan 7, 2026
@Rohit3523 Rohit3523 marked this pull request as ready for review January 7, 2026 18:51
@Rohit3523 Rohit3523 requested a deployment to approve_e2e_testing January 7, 2026 18:51 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to experimental_android_build January 7, 2026 18:54 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to experimental_ios_build January 7, 2026 18:54 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to official_android_build January 7, 2026 18:54 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to official_ios_build January 7, 2026 18:54 — with GitHub Actions Waiting
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/sagas/room.js (1)

36-47: Critical: clearUserTyping must forward args to clear typing in the correct context.

The clearUserTyping function doesn't accept or forward the args parameter (including tmid) when calling emitTyping(rid, false) on line 39. This means when a user stops typing in a thread, the server won't know which context to clear the typing indicator from, potentially leaving the indicator stuck in the thread or clearing it from the wrong location.

🐛 Proposed fix
-const clearUserTyping = function* clearUserTyping({ rid, status }) {
+const clearUserTyping = function* clearUserTyping({ rid, status, args }) {
 	try {
 		if (!status) {
-			yield emitTyping(rid, false);
+			yield emitTyping(rid, false, args);
 			if (inactiveTypingTask) {
 				yield cancel(inactiveTypingTask);
 			}
🧹 Nitpick comments (1)
app/containers/MessageComposer/components/ComposerInput.tsx (1)

362-365: Consider omitting the empty object when tmid is not present.

Since the args parameter is optional in the userTyping function signature, you can pass undefined or omit it entirely instead of passing an empty object {} when tmid is not present.

♻️ Proposed refactor
 	const handleTyping = (isTyping: boolean) => {
 		if (sharing || !rid) return;
-		dispatch(userTyping(rid, isTyping, tmid ? { tmid } : {}));
+		dispatch(userTyping(rid, isTyping, tmid ? { tmid } : undefined));
 	};
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b990e60 and 4a1e2e9.

📒 Files selected for processing (4)
  • app/actions/room.ts
  • app/containers/MessageComposer/components/ComposerInput.tsx
  • app/lib/services/restApi.ts
  • app/sagas/room.js
🧰 Additional context used
🧬 Code graph analysis (4)
app/actions/room.ts (1)
app/actions/actionsTypes.ts (1)
  • ROOM (16-26)
app/lib/services/restApi.ts (2)
app/definitions/IRoom.ts (1)
  • IRoom (18-65)
app/lib/methods/helpers/compareServerVersion.ts (1)
  • compareServerVersion (10-15)
app/sagas/room.js (1)
app/lib/services/restApi.ts (1)
  • emitTyping (953-963)
app/containers/MessageComposer/components/ComposerInput.tsx (1)
app/actions/room.ts (1)
  • userTyping (117-124)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: format
🔇 Additional comments (4)
app/actions/room.ts (2)

42-50: LGTM! Clean type definition for thread typing context.

The new IUserTypingArgs type and its integration into IUserTyping properly enable passing thread context to typing events. The optional fields allow backward compatibility.


117-123: LGTM! Function signature correctly updated.

The userTyping action creator properly accepts and forwards the optional args parameter through the Redux action payload.

app/sagas/room.js (1)

54-66: LGTM! Typing start correctly forwards thread context.

The watchUserTyping saga properly extracts and forwards the args parameter to emitTyping when typing begins.

app/lib/services/restApi.ts (1)

953-963: Verify server API support for args parameter in version 4.0.0+.

The client-side implementation correctly gates the new args parameter and user-activity endpoint behind a server version check (>= 4.0.0). However, verification of actual server-side support for the args parameter (including tmid) in the stream-notify-room endpoint requires access to the Rocket.Chat server repository or official API documentation, which is outside this client codebase.

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.

2 participants