-
Notifications
You must be signed in to change notification settings - Fork 271
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
Fix is_user_mention_enabled
and is_room_mention_enabled
#2357
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2357 +/- ##
==========================================
+ Coverage 77.57% 77.61% +0.03%
==========================================
Files 175 175
Lines 18471 18536 +65
==========================================
+ Hits 14329 14386 +57
- Misses 4142 4150 +8
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet! We could use a test helper, and then this would be good to go 👍
is_user_mention_enabled
and is_room_mention_enabled
With this PR:
is_user_mention_enabled()
now returns the value of the new push rule.m.rule.is_user_mention
if the rule exists. Previously, the value of the new push rule was only returned if it was enabled.is_room_mention_enabled()
now returns the value of the new push rule.m.rule.is_room_mention
if the rule exists. Previously, the value of the new push rule was only returned if it was enabled.The previous implementation was problematic because setting
is_room_mention_enabled()
tofalse
actually makes 2 API calls:.m.rule.is_room_mention
.m.rule.roomnotif
And the client app was seeing the room mention enabled after the first call because the previous implementation was returning the state of the deprecated rule if the new one was disabled.
In this way, the new push rule is the one used if it exists.
This PR also fixes some UnitTests for
notification_settings
crate.