Closed Bug 317127 Opened 19 years ago Closed 15 years ago

Comment containing "Created an attachment (" sends bugmail even if bugmail should *only* be sent when new attachments are added

Categories

(Bugzilla :: Email Notifications, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: Waldo, Assigned: mkanat)

References

()

Details

(Whiteboard: [blocker will fix])

Attachments

(1 file)

I have an account, jwalden+spammybugs@mit.edu, which I use to find out about progress on bugs where the noise-to-signal ratio is very high. (Examples of such bugs are the acid2 bug, the inline-block bug, and the CSS2 @page support bug.) I have prefs set so that bugmail is only sent when my relationship to the bug is Assignee/QA Contact/Reporter/CCed and when either "New attachments are added" or "Some attachment data changes". I recently received bugmail about bug 289480 comment 79, which shouldn't have generated bugmail. After doing some testing in landfill (see the tip landfill's bug 2582), it seems "New attachments are added" is set when a comment includes the string "Created an attachment(". Instead, the property should only be set when an attachment is actually added to the bug. If further information is needed, I'm more than happy to provide it.
Actually, we discovered in our installation that if you're setup to get comments in your mail prefs, you will actually get notifications on practically any status change, because of how the code is setup in Bugzilla/User.pm: if ($commentField =~ /Created an attachment \(/) { $events{+EVT_ATTACHMENT} = 1; } elsif ($commentField ne '') { $events{+EVT_COMMENT} = 1; } $commentField in this case turns out to be a string containing all comments ever made to the bug since its inception, which means that EVT_COMMENT will always get set (unless EVT_ATTACHMENT does). I have a fix I'm testing now, will submit a patch...
Attached patch fix for Bugzilla/User.pm (deleted) — Splinter Review
Adds a timestamp check to see if the most recent comment was actually made as part of the latest bug change -- previously any existing comments for a bug would cause EVT_COMMENT to be set to true. Also, restricts attachment checks to the comments, as adding an attachment adds a comment, so we only want the most recent of those also...
Attachment #378951 - Flags: review-
Comment on attachment 378951 [details] [diff] [review] fix for Bugzilla/User.pm It's wrong to say that any old comment triggers EVT_COMMENT. And we are not going to query the DB for each user. This is not the right fix.
Assignee: email-notifications → mkanat
Depends on: 452919
Whiteboard: [blocker will fix]
Target Milestone: --- → Bugzilla 3.6
Blocks: 526734
No longer blocks: 526734
Fixed by blocker.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: