Discussion:
[Trac-dev] No more notifications for users without an email in 1.2.1
Emmanuel BOUAZIZ
2017-04-05 14:31:47 UTC
Permalink
Hi!

I was previously running on the Trac 1.2-stable branch at `0d5ff1a3f` and
everything was fine regarding notifications.

I aligned on v1.2.1 when it was released and suddenly most users didn't get
notifications anymore. They were all users
that do not have an email address: we use the `use_short_addr` option so we
don't need to fill the email address.

I noticed the modifications in ticket #12658

in `mail.py` in the `match_recipient()` function in `RecipientMatcher` :

before #12658, a user with no email address would not appear in
`self.email_map` and `use_short_addr` or `smtp_default_domain` options
would be applied.

Now, any authenticated user in the database will appear in `self.users` so
we always run the `if address in self.users:` branch for authenticated
users and never the `elif ...` branch and the `use_short_addr` or
`smtp_default_domain` options are never applied to these users.

So this these options are broken now in this case.

I did not know if I should re-open the ticket or create a new one so I did
neither.
I also don't have a patch because the logic looks complicated with lots of
use-cases that I don't even know exist, sorry.
--
Emmanuel
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
Jun Omae
2017-04-05 16:38:16 UTC
Permalink
Hi,

On Wed, Apr 5, 2017 at 11:31 PM, Emmanuel BOUAZIZ
Post by Emmanuel BOUAZIZ
I aligned on v1.2.1 when it was released and suddenly most users didn't get
notifications anymore. They were all users
that do not have an email address: we use the `use_short_addr` option so we
don't need to fill the email address.
I noticed the modifications in ticket #12658
before #12658, a user with no email address would not appear in
`self.email_map` and `use_short_addr` or `smtp_default_domain` options would
be applied.
Now, any authenticated user in the database will appear in `self.users` so
we always run the `if address in self.users:` branch for authenticated users
and never the `elif ...` branch and the `use_short_addr` or
`smtp_default_domain` options are never applied to these users.
So this these options are broken now in this case.
Thanks for the investigating and the details.
It seems another issue is introduced by r15356 for #12658.

Could you try the attached patch? (authenticated-user-without-email.diff)
I'll add unit tests if the patch works well.
Post by Emmanuel BOUAZIZ
I did not know if I should re-open the ticket or create a new one so I did
neither.
I also don't have a patch because the logic looks complicated with lots of
use-cases that I don't even know exist, sorry.
Please create a new ticket about this issue.
--
Jun Omae <***@gmail.com> (倧前 最)
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
Emmanuel BOUAZIZ
2017-04-06 08:41:22 UTC
Permalink
Hi,

thank for your quick reply.
Post by Jun Omae
Thanks for the investigating and the details.
It seems another issue is introduced by r15356 for #12658.
Could you try the attached patch? (authenticated-user-without-email.diff)
I'll add unit tests if the patch works well.
I tried your patch and it work for my use-case.
Post by Jun Omae
Please create a new ticket about this issue.
#12759 created.

Have a nice day !
--
Emmanuel
--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-dev+***@googlegroups.com.
To post to this group, send email to trac-***@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
Loading...