Skip to content
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

Avoid mailing users that have explicitly unwatched an issue (#10475) #10500

Merged
merged 2 commits into from
Feb 27, 2020

Conversation

6543
Copy link
Member

@6543 6543 commented Feb 27, 2020

backports #10475

models/issue_watch.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 27, 2020
models/issue_watch.go Outdated Show resolved Hide resolved
@lafriks lafriks added this to the 1.11.2 milestone Feb 27, 2020
@6543
Copy link
Member Author

6543 commented Feb 27, 2020

@guillep2k done

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 27, 2020
@strk
Copy link
Member

strk commented Feb 27, 2020

I understand this is a backport so LGTM (just to move things further) but it doesn't seem clean to call that getIssuesWatchers twice, rather I'd expect such a function to internally remove explicit unsubscribers...

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 27, 2020
@jolheiser jolheiser merged commit 50f2e90 into go-gitea:release/v1.11 Feb 27, 2020
@6543 6543 deleted the backports_10475 branch February 27, 2020 17:45
@6543
Copy link
Member Author

6543 commented Feb 27, 2020

@strk it doesnt work that way ... since you can "watch" via repo watch or participants or issuewatch ... and there are 3 types of issuewatch:

    1. No entry in table (so it use default witch is not subscribed unless you watch the repo or have participated)
    1. IssueWatch.IsWatching = true; explicit watch
    1. IssueWatch.IsWatching = false; explicit DONT watch

So i can query the userIDs in two functioncalls or query all IssueWatch entrys for a issue and itterate throu it fo set / unset ...

@zeripath zeripath changed the title [BugFix] Avoid mailing explicit unwatched (#10475) Avoid mailing users that have explicitly unwatched an issue (#10475) Mar 6, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants