fix: check deleting user's unmuted status instead of message sender#38415
fix: check deleting user's unmuted status instead of message sender#38415kodiakhq[bot] merged 6 commits intodevelopfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 61dff8b The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis pull request fixes a permission validation bug in read-only rooms by changing authorization functions to pass the full user object instead of just the userId. This ensures permission checks validate the deleting user's unmuted status rather than the message sender's status. The change propagates through upload service, deletion functions, and related APIs. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! 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. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #38415 +/- ##
===========================================
- Coverage 70.36% 70.34% -0.02%
===========================================
Files 3161 3161
Lines 110653 110653
Branches 19857 19879 +22
===========================================
- Hits 77860 77838 -22
- Misses 30761 30778 +17
- Partials 2032 2037 +5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
02169c6 to
e5715fb
Compare
e5715fb to
f3b02b6
Compare
4753784 to
7ac8c14
Compare
Proposed changes (including videos or screenshots)
Fixes incorrect permission check when deleting messages in read-only rooms with unmuted users. The
canDeleteMessageAsyncfunction was checking if the message sender (u.username) was in the room's unmuted list, when it should check if the user trying to delete is unmutedIssue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.