Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ui/TextMessageItemBody/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function TextMessageItemBody({
return tokenizeMessage({
messageText: message?.message,
});
}, [message?.updatedAt]);
}, [message]);
Copy link
Contributor

Choose a reason for hiding this comment

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

@ishubham21 Thanks for your contribution and the detailed explanation. I see your point.

Suggested change
}, [message]);
}, [message?.message]);

I wonder ^ this would this fix your issue too. I think this value will be updated when the streaming message is coming.
The reason I'm asking is, putting the whole object in the dependency array is not an optimal way in terms of performance.

Copy link
Author

@ishubham21 ishubham21 Jan 16, 2024

Choose a reason for hiding this comment

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

@AhyoungRyu
Definitely this will fix the issue we are facing. This PR was just an indicative solution - the root cause lies with updatedAt not being set properly.
If we proceed with this change, can we do this for scroll events as well? I believe they too have their dependencies set as updatedAt and thus might need an update as well

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah if you're talking about this part, will make the change as well.

Copy link
Author

Choose a reason for hiding this comment

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

@AhyoungRyu yes that’s the part. Thank you for pointing it out. Should I push the update, or sendbird team will do it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I'll do that. Thanks for confirming it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@ishubham21 Since we're not accepting the code change from outside at the moment, I made a separate PR based on yours. #928
We're aiming to publish a new version this afternoon. We'll let you know once it's out.

Thanks again :)

return (
<Label
type={LabelTypography.BODY_1}
Expand Down