Skip to content

[fix] Resolved TypingIndicator.tsx bug not cleaning up newHandlerId - #1444

Open
rob-ryszewski wants to merge 1 commit into
sendbird:mainfrom
rob-ryszewski:bugfix-typing-indictator-handler-cleanup
Open

[fix] Resolved TypingIndicator.tsx bug not cleaning up newHandlerId#1444
rob-ryszewski wants to merge 1 commit into
sendbird:mainfrom
rob-ryszewski:bugfix-typing-indictator-handler-cleanup

Conversation

@rob-ryszewski

Copy link
Copy Markdown

Summary

TypingIndicator.tsx has a useEffect that does:

const newHandlerId = uuidv4();
sb.groupChannel.addGroupChannelHandler(newHandlerId, handler);
setHandlerId(newHandlerId);

Yet in that useEffect's cleanup function, it targets removing handlerId instead of newHandlerId:

sb.groupChannel.removeGroupChannelHandler(handlerId);

This causes TypingIndicator to leak group channel handlers that stay subscribed and un-removed.

I came across this in a scenario where this compounded and caused many leaked handlers that then led to other issues.

Fix

sb.groupChannel.removeGroupChannelHandler(newHandlerId ?? handlerId);

To defensively cover the scenario were sb.groupChannel.addGroupChannelHandler is not defined, and the code never instantiates a newHandlerId, it falls back to ?? handlerId.

Checklist

  • All tests pass locally with my changes

@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

👷 Deploy request for sendbird-uikit-react pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 8d45471

@rob-ryszewski
rob-ryszewski force-pushed the bugfix-typing-indictator-handler-cleanup branch from 7113ddf to 8d45471 Compare July 26, 2026 03:14
@rob-ryszewski

Copy link
Copy Markdown
Author

@sf-tyler-jeong could I get your review? 3 line bugfix to stop leaking handlers, potentially unboundedly

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.

1 participant