User remains subscribed to issues after access to project has been removed.
Migrated from GitHub #9451
We have a user that used to be part of a (private) project on our install of GitLab. During this time, the user had subscribed to issues related to the project. They have since been removed from the project, yet GitLab continues to send them notifications related to issues from the project they were subscribed to.
Components Check
- GitLab: 7.11.3
- GitLab Shell: 2.6.3
- Ruby: 2.1.6p336
- Rails: 4.1.9
Response from @stanhu:
I looked into this. You're right--GitLab doesn't do anything with the subscriptions table if project memberships change. This should be straightforward to fix: look at all the user's subscriptions when the project membership changes, and remove the relevant subscriptions if the user no longer has access.
The main issue with implementing this right now is that each entry in the subscriptions table only refers to an issue or merge request. I think to make our lives easier we'll need to supplement each row with a project_id so that we can filter relevant subscriptions without having to do a number of additional SQL queries.