-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: prevent multiple listener.once updateSubscription
#35908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #35908 +/- ##
===========================================
- Coverage 61.16% 61.15% -0.01%
===========================================
Files 3014 3014
Lines 71625 71628 +3
Branches 16403 16404 +1
===========================================
- Hits 43808 43806 -2
- Misses 24850 24855 +5
Partials 2967 2967
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
apps/meteor/client/views/room/providers/hooks/useChatMessagesInstance.spec.ts
Show resolved
Hide resolved
updateSubscriptionupdateSubscription
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
https://rocketchat.atlassian.net/browse/ARCH-1585
found during #35880
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
This pull request aims to address an issue in the Rocket.Chat repository by preventing multiple
listener.oncecalls toupdateSubscription. The changes are made in two files:readStateManager.ts: A new method has been added to subscribe to message loading events and update the first unread record ID.
useChatMessagesInstance.ts: A
useEffecthook is introduced to manage message subscriptions usingchatMessages.readStateManager. The hook utilizes optional chaining to avoid runtime errors whensubscriptionorchatMessagesare temporarily undefined.These updates are intended to enhance the management of message subscriptions and improve the stability of the chat application.