Defect #7421

no email sent with 'Notifiy for any event on the selected projects only'

Added by Arnaud Martel almost 7 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2011-01-24
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email notifications
Target version:1.1.1
Resolution:Fixed Affected version:1.1.0

Description

I just upgraded from trunk (r4744) and I have trouble with notification:

How to reproduce:
  • In my account:
    • I selected "For any event on the selected projects only"
    • I checked project A and project B
  • Another user created an issue in project C and assigned it to me
    => No notification is sent to me
  • Another user created an issue in project B and assigned it to me
    => A notification is sent to me

According to "my account, Email notifications", I should have received an email ("For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)."

A possible solution (not sure but...):
When looking at app/models/user.rb, there is a piece of code:

  # Utility method to help check if a user should be notified about an
  # event.
  #
  # TODO: only supports Issue events currently
  def notify_about?(object)
    case mail_notification
    when 'all'
      true
    when 'selected'
      # Handled by the Project
    when 'none'
      false
    when 'only_my_events'
      if object.is_a?(Issue) && (object.author == self || object.assigned_to == self)
        true
      else
        false
      end

From what I understand, the "when 'selected'" case doesn't manage the unselected projects so I changed it to:

    when 'selected'
      # Handled by the Project
      if object.is_a?(Issue) && (object.author == self || object.assigned_to == self)
        true
      end

And it seems to solve my problem (ie: notifications are working again...)

Kind regards,
Arnaud

Associated revisions

Revision 4761
Added by Jean-Philippe Lang almost 7 years ago

Fixed: no email sent with 'Notifiy for any event on the selected projects only' (#7421).

History

#1 Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from New to Resolved
  • Target version set to 1.1.1
  • Affected version (unused) changed from devel to 1.1.0
  • Resolution set to Fixed
  • Affected version set to 1.1.0

This behaviour was broken by some refactoring (r4218). Fixed and tests added in r4761.

#2 Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from Resolved to Closed

Merged in 1.1-stable.

Also available in: Atom PDF