Skip to content

Fix missing source information in group notifications#19247

Draft
geetxnshgoyal wants to merge 2 commits intoopenSUSE:masterfrom
geetxnshgoyal:group-notification-source-missing
Draft

Fix missing source information in group notifications#19247
geetxnshgoyal wants to merge 2 commits intoopenSUSE:masterfrom
geetxnshgoyal:group-notification-source-missing

Conversation

@geetxnshgoyal
Copy link
Contributor

Fixes #19003

Problem

Group notifications for adding or removing members were missing the originator information (payload[:who]), leading to notifications that displayed "Someone" as the source of the action.

Solution

This PR ensures the originator's login is captured and displayed in group notifications by utilizing the existing thread-local User.session.

Key Changes:

  • Model Layer: Updated Group#delete_user to correctly populate the who field in Event::RemovedUserFromGroup events using User.session&.login.
  • Notification Display: Refactored NotificationGroup#link_text to display the originator's name while maintaining the existing sentence structure.
  • Improved Fallbacks: Replaced the hardcoded "Someone" string with a professional passive voice fallback (e.g., 'User' was removed from the group 'obs-developers'). This fallback is only used if no session user is present (e.g., automated backend actions).
  • UI Cleanup: Set NotificationGroup#description to empty, as the primary action details (who, whom, and group name) are now included in the main notification heading.

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Feb 10, 2026
@geetxnshgoyal geetxnshgoyal force-pushed the group-notification-source-missing branch from 27223b4 to 0b4f5d6 Compare February 10, 2026 12:44
@geetxnshgoyal geetxnshgoyal force-pushed the group-notification-source-missing branch 5 times, most recently from bdca20f to b5a4645 Compare February 10, 2026 14:50
@geetxnshgoyal geetxnshgoyal marked this pull request as draft February 10, 2026 15:00
This change modifies Group#replace_members to manually add/remove users via add_user/remove_user instead of using the users.replace association. This allows us to handle race conditions in add_user where a user might be added concurrently. We also added explicit users.reload in replace_members to unsure the in-memory association remains consistent. Additionally, we added tests to cover the race condition handling in add_user.
@geetxnshgoyal geetxnshgoyal force-pushed the group-notification-source-missing branch from f0d3bcb to b53a3cd Compare February 11, 2026 17:01
@github-actions github-actions bot added the Test Suite / CI 💉 Things related to our tests/CI label Feb 11, 2026
This update resolves a moderate severity SSRF vulnerability (GHSA-33mh-2634-fwr2) in Faraday < 2.14.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend Things related to the OBS RoR app Test Suite / CI 💉 Things related to our tests/CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group Notification Source Missing

1 participant