You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MessageReceiptManager keeps a lazy reference to the RepositoryFacade. The facade is switched with a new instance if the connected User changes, but the MessageReceiptManager is not.
So if the connected User changes, the MessageReceiptManager by keeping a lazy reference to the (old) RepositoryFacade attempts to read outdated data (from the previously connected User).
🛠 Implementation details
Remove the lazy persistence of the RepositoryFacade from the MessageReceiptManager
🎨 UI Changes
NA
🧪 Testing
Log in, log out, and log in with a different user
Check the logs for Chat:MessageReceiptManager
There should be no WARNING logs with text: [markChannelsAsDelivered] Current user not found
Summary by CodeRabbit
Bug Fixes
Fixed an issue where the markDelivered operation would not function correctly when switching between users.
✏️ Tip: You can customize this high-level summary in your review settings.
A refactoring that renames the MessageReceiptManager constructor parameter from getRepositoryFacade to repositoryFacade and removes lazy initialization. Updates are propagated through ChatClient initialization, internal method calls, and tests. A changelog entry documents that markDelivered now works when switching users.
Changes
Cohort / File(s)
Summary
Documentation CHANGELOG.md
Added changelog entry documenting markDelivered operation now works when switching users.
Renamed constructor parameter getRepositoryFacade to repositoryFacade in MessageReceiptManager. Removed lazy initialization wrapper; updated all internal call sites to invoke the function via repositoryFacade(). Updated Javadoc accordingly.
Updated test fixture to use new constructor parameter name repositoryFacade.
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers
gpunto
Poem
🐰 A parameter rename, clean and bright, getRepositoryFacade takes flight,
Now repositoryFacade stands tall,
No lazy tricks, just direct calls,
When users switch, marked delivered's right! ✨
Docstring coverage is 16.67% 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 concisely summarizes the main change: fixing markDelivered functionality when users switch.
Description check
✅ Passed
The description covers the goal, implementation details, and testing instructions, but is missing sections like UI Changes detail (shows NA), contributor checklist, and reviewer checklist.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
📝 Generate docstrings
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Goal
The
MessageReceiptManagerkeeps alazyreference to theRepositoryFacade. The facade is switched with a new instance if the connectedUserchanges, but theMessageReceiptManageris not.So if the connected
Userchanges, theMessageReceiptManagerby keeping alazyreference to the (old)RepositoryFacadeattempts to read outdated data (from the previously connectedUser).🛠 Implementation details
lazypersistence of theRepositoryFacadefrom theMessageReceiptManager🎨 UI Changes
NA
🧪 Testing
Chat:MessageReceiptManager[markChannelsAsDelivered] Current user not foundSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.