Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12173 closed defect (fixed)

Users added to CC are not notified by CarbonCopySubscriber

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.9
Component: notification Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fixed: user added to empty CC list was not notified (1.2).

API Changes:

Chrome.cc_list returns an empty list when the input is falsy.

Internal Changes:

Description

The issue occurs when there are no users in the CC list, in which case event.changes['fields']['cc']['old'] is None: tags/trac-1.1.6/trac/ticket/notification.py@:466#L442.

>>> from trac.web.chrome import Chrome
>>> from trac.test import EnvironmentStub
>>> env = EnvironmentStub()
>>> chrome = Chrome(env)
>>> to_set = lambda cc: set(chrome.cc_list(cc))
>>> to_set(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <lambda>
  File "trac/web/chrome.py", line 1276, in cc_list
    for cc in re.split(r'[;,]', cc_field):
  File "/home/user/Workspace/t11944/py2.7/lib/python2.7/re.py", line 167, in split
    return _compile(pattern, flags).split(string, maxsplit)
TypeError: expected string or buffer

We could fix the issue with the following:

  • trac/web/chrome.py

    diff --git a/trac/web/chrome.py b/trac/web/chrome.py
    index ba1896b..d4ed748 100644
    a b class Chrome(Component):  
    12731273    def cc_list(self, cc_field):
    12741274        """Split a CC: value in a list of addresses."""
    12751275        ccs = []
    1276         for cc in re.split(r'[;,]', cc_field):
     1276        for cc in re.split(r'[;,]', cc_field or ''):
    12771277            cc = cc.strip()
    12781278            if cc:
    12791279                ccs.append(cc)

Attachments (0)

Change History (4)

comment:1 by Jun Omae, 9 years ago

It seems Chrome.cc_list() in 1.0-stable has the same issue. I think we should apply it on 1.0-stable to make robust.

Version 0, edited 9 years ago by Jun Omae (next)

comment:2 by Ryan J Ollos, 9 years ago

Milestone: 1.21.0.9

I'll also add test coverage for CarbonCopySubscriber.

comment:3 by Ryan J Ollos, 9 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:4 by Ryan J Ollos, 9 years ago

API Changes: modified (diff)
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to trunk in [14262]. Changes to trac.web.chrome backported to 1.0-stable in [14263].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.