Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13045 closed enhancement (fixed)

Enter Quiet Mode does not work

Reported by: roger.oberholtzer@… Owned by: Ryan J Ollos
Priority: normal Component: QuietPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

When I press "Enter Quiet Mode", the rendered wep page only contains this text:

{"is_quiet": true, "label": "Leave Quiet Mode"}

The link for the page says:

http://path/to/trac/quietmode/toggle

I think the toggle is happening: if I go to a ticket, it offers "Leave Quiet Mode". The same thing happens when toggling the other way. So it just looks like an intermediate page is shown.

The browser is Firefox 45.0.1 and 50.0.1 on Linux.

In Internet Explorer on Windows, I get a message asking if I want to open or save toggle.json. Which is I guess the text that Firefox is showing to me.

Attachments (3)

debug1.log (37.4 KB) - added by roger.oberholtzer@… 7 years ago.
Debug of still sending mail
debug2.log (29.3 KB) - added by roger.oberholtzer@… 7 years ago.
components.txt (9.8 KB) - added by roger.oberholtzer@… 7 years ago.
trac.ini components

Download all attachments as: .zip

Change History (41)

comment:1 Changed 7 years ago by Jun Omae

Type: defectenhancement

This plugin integrates with AnnouncerPlugin, not new Notification system since Trac 1.2.

comment:2 Changed 7 years ago by Jun Omae

I think it should prevent to use on Trac 1.2 without AnnouncerPlugin.

comment:3 Changed 7 years ago by Massimo

Ok. I don't even see the "Quiet Mode" button on Trac 1.2. It is highly desirable to have that feature in 1.2 for Batch modifications. Is that a feature request to Trac or is this Plugin also focusing the new Notification system since Trac 1.2?

comment:4 in reply to:  3 Changed 7 years ago by anonymous

It is highly desirable to have that feature in 1.2 for Batch modifications.

Without Announcer batch modifications only send a single batch notification.

comment:5 Changed 7 years ago by Ryan J Ollos

We'll need to make this compatible with Trac 1.2, but as noted, I don't see the specific need for this feature for BatchModify since only one notification message is sent by Trac's notification system.

comment:6 Changed 7 years ago by anonymous

It is also very useful in a ticket triage. We have these occasionally.

comment:7 Changed 7 years ago by Ryan J Ollos

Owner: set to Ryan J Ollos
Status: newaccepted

comment:8 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 16300:

1.2.0dev: Make compatible with Trac 1.2 notification system

Fixes #13045.

comment:9 Changed 7 years ago by Ryan J Ollos

Updated QuietPlugin@18, but I haven't actually published to PyPI yet. I'll wait for the end of the week to see if I get any feedback on the changes.

For now you should be able to install with:

$ pip install svn+https://trac-hacks.org/svn/quietplugin/1.2/

It often works better to uninstall old versions of TracQuiet first. I can often run the command repeatedly when there are multiple eggs installed for an older version of the plugin:

$ pip uninstall TracQuiet  # repeat command until "not installed" is seen
$ pip install -U pip setuptools wheel

I wonder if there is a better way to implement this than overriding EmailDistributor. I don't know the notification API well enough yet, but I wonder if a notification subscriber could be used instead.

comment:10 Changed 7 years ago by roger.oberholtzer@…

I have installed the plugin and now I get a different background that says Shhh... So that works.

But when I changed a ticket while in quite mode, I still received an e-mail. I enabled all 4 options in the Admin tab for this plugin.

comment:11 Changed 7 years ago by Ryan J Ollos

You need to disabled trac.notification.mail.EmailDistributor. See QuietPlugin#Installation.

comment:12 Changed 7 years ago by roger.oberholtzer@…

I have disabled this, but I still get e-mails. For both comments and adding attachments.

I am only using the Trac notification system, as the Announcer plugin seems not to work with Trac 1.2.

comment:13 Changed 7 years ago by Ryan J Ollos

In 16301:

1.2.0dev: Add debug logging in QuietEmailDistributor

Refs #13045.

comment:14 Changed 7 years ago by Ryan J Ollos

In 16302:

1.2.0dev: Improve debug level log message

Refs #13045.

comment:15 Changed 7 years ago by Ryan J Ollos

Please update plugin to r16302 and enable debug level logging. Example:

10:05:39 Trac[mail] DEBUG: Email address w/o domain: somebody
10:05:39 Trac[mail] DEBUG: Email address w/o domain: user4
10:05:39 Trac[mail] DEBUG: Email address w/o domain: value propagation
10:05:39 Trac[api] DEBUG: Adding (user1 [1]) for 'always' on rule (CarbonCopySubscriber) for (email)
10:05:39 Trac[api] DEBUG: Adding (user2 [1]) for 'always' on rule (TicketPreviousUpdatersSubscriber) for (email)
10:05:39 Trac[web_ui] DEBUG: QuietEmailDistributor skipping distribution of TicketChangeEvent because quiet mode is enabled for user1

Changed 7 years ago by roger.oberholtzer@…

Attachment: debug1.log added

Debug of still sending mail

comment:16 Changed 7 years ago by roger.oberholtzer@…

I have attached the relevant part of the log. I did receive the e-mail while in quiet mode.

comment:17 Changed 7 years ago by Jun Omae

trac.notification.mail.EmailDistributor is still enabled. It should be disabled.

2017-03-10 07:31:13,515 Trac[mail] DEBUG: EmailDistributor has found the following formats capable of handling 'email' of 'ticket': text/html, text/plain

If QuietEmailDistributor is used, ... Trac[web_ui] DEBUG: EmailDistributor ... would be logged.

comment:18 in reply to:  17 ; Changed 7 years ago by Jun Omae

Replying to Jun Omae:

trac.notification.mail.EmailDistributor is still enabled. It should be disabled.
[...]
If QuietEmailDistributor is used, ... Trac[web_ui] DEBUG: EmailDistributor ... would be logged.

Ah, I misunderstood. Please ignore it.

comment:19 in reply to:  18 Changed 7 years ago by Ryan J Ollos

Replying to Jun Omae:

Replying to Jun Omae:

trac.notification.mail.EmailDistributor is still enabled. It should be disabled.
[...]
If QuietEmailDistributor is used, ... Trac[web_ui] DEBUG: EmailDistributor ... would be logged.

Ah, I misunderstood. Please ignore it.

Maybe I should add some logging so we can be sure that QuietEmailDistributor is being called, even when quiet mode is not enabled?

comment:20 Changed 7 years ago by Jun Omae

Some logging sounds good.

Also, for Trac core, it would be good to use self.__class__.__name__ rather than EmailDistributor in the literal to log.

  • trac/notification/mail.py

    diff --git a/trac/notification/mail.py b/trac/notification/mail.py
    index 99cceecd3..220334c0a 100644
    a b class EmailDistributor(Component): 
    300300            self.log.error("EmailDistributor No formats found for %s %s",
    301301                           transport, event.realm)
    302302            return
    303         self.log.debug("EmailDistributor has found the following formats "
    304                        "capable of handling '%s' of '%s': %s", transport,
    305                        event.realm, ', '.join(formats.keys()))
     303        self.log.debug("%s has found the following formats capable of "
     304                       "handling '%s' of '%s': %s", self.__class__.__name__,
     305                       transport, event.realm, ', '.join(formats.keys()))
    306306
    307307        notify_sys = NotificationSystem(self.env)
    308308        always_cc = set(notify_sys.smtp_always_cc_list)

comment:21 in reply to:  20 Changed 7 years ago by Ryan J Ollos

Replying to Jun Omae:

Also, for Trac core, it would be good to use self.__class__.__name__ rather than EmailDistributor in the literal to log.

Thanks, created trac:#12718.

comment:22 Changed 7 years ago by Ryan J Ollos

In 16322:

1.2.0dev: Log notification activity when not in quiet mode

Refs #13045.

comment:23 Changed 7 years ago by Ryan J Ollos

Please try r16322. If you see the following logged:

11:42:17 Trac[web_ui] DEBUG: QuietEmailDistributor dispatching to EmailDistributor

then we should look at the quietmode values saved in your session_attributes table.

comment:24 Changed 7 years ago by Ryan J Ollos

Any updates on the reported issue? Is it working for you now?

Changed 7 years ago by roger.oberholtzer@…

Attachment: debug2.log added

comment:25 in reply to:  24 Changed 7 years ago by anonymous

Replying to Ryan J Ollos:

Any updates on the reported issue? Is it working for you now?

No change. I still get e-mails. I have enabled logging and attached the log.

comment:26 Changed 7 years ago by Ryan J Ollos

The log message in comment:23 does not appear, so you must have an installation issue. The latest version of the plugin doesn't appear to be installed and/or loaded.

comment:27 Changed 7 years ago by roger.oberholtzer@…

I checked it out with:

# svn co https://trac-hacks.org/svn/quietplugin/1.2/
A    1.2/quiet
A    1.2/quiet/templates
A    1.2/quiet/htdocs
A    1.2/quiet/web_ui.py
A    1.2/quiet/htdocs/quiet.css
A    1.2/quiet/htdocs/quiet.js
A    1.2/quiet/htdocs/quiet.png
A    1.2/quiet/__init__.py
A    1.2/setup.py
A    1.2/COPYING
A    1.2/setup.cfg
 U   1.2
Checked out revision 16331.

I am pretty sure this is what is installed.

comment:28 Changed 7 years ago by Ryan J Ollos

Could you share your [components] section of trac.ini?

Changed 7 years ago by roger.oberholtzer@…

Attachment: components.txt added

trac.ini components

comment:29 in reply to:  28 Changed 7 years ago by anonymous

Replying to Ryan J Ollos:

Could you share your [components] section of trac.ini?

Here it is.

comment:30 Changed 7 years ago by Ryan J Ollos

EmailDistributor is enabled and QuietEmailDistributor is disabled. Changes:

-quiet.web_ui.quietemaildistributor = disabled
+quiet.web_ui.quietemaildistributor = enabled
+trac.notification.mail.EmailDistributor = disabled

or

-quiet.web_ui.quietajaxmodule = enabled
-quiet.web_ui.quietemaildistributor = disabled
-quiet.web_ui.quietlistenerajaxmodule = enabled
-quiet.web_ui.quietmodule = enabled
+quiet.* = enabled
+trac.notification.mail.EmailDistributor = disabled

See step (3) in QuietPlugin#Installation.

comment:31 in reply to:  30 ; Changed 7 years ago by roger.oberholtzer@…

Replying to Ryan J Ollos:

EmailDistributor is enabled and QuietEmailDistributor is disabled. Changes:

-quiet.web_ui.quietemaildistributor = disabled
+quiet.web_ui.quietemaildistributor = enabled
+trac.notification.mail.EmailDistributor = disabled

or

-quiet.web_ui.quietajaxmodule = enabled
-quiet.web_ui.quietemaildistributor = disabled
-quiet.web_ui.quietlistenerajaxmodule = enabled
-quiet.web_ui.quietmodule = enabled
+quiet.* = enabled
+trac.notification.mail.EmailDistributor = disabled

See step (3) in QuietPlugin#Installation.

I thought I had this correct...

After this change, I think it is working.

Will this plugin be compatible with the Announcer plugin? I dream of being able to use that in Trac 1.2...

comment:32 in reply to:  31 ; Changed 7 years ago by Ryan J Ollos

Replying to roger.oberholtzer@…:

Will this plugin be compatible with the Announcer plugin?

Yes, should be.

I dream of being able to use that in Trac 1.2...

What features do you want that haven't been included in Trac 1.2?

comment:33 in reply to:  32 ; Changed 7 years ago by roger.oberholtzer@…

Replying to Ryan J Ollos:

What features do you want that haven't been included in Trac 1.2?

I was thinking of all the other plugins that don't sent notifications in a way that is compatible with the Announcer plugin on 1.2. Would this plugin work with the Announcer plugin on a Trac 1.2 system?

comment:34 in reply to:  33 Changed 7 years ago by Ryan J Ollos

Replying to roger.oberholtzer@…:

I was thinking of all the other plugins that don't sent notifications in a way that is compatible with the Announcer plugin on 1.2.

Which plugins? Presumably they need to be adapted to the new Trac notification system and making Announcer work with Trac 1.2 isn't going to solve that. AnnouncerPlugin for Trac 1.2 will just include the features that haven't yet been ported to Trac 1.2.

Would this plugin work with the Announcer plugin on a Trac 1.2 system?

Yes, but once Announcer plugin is ported to Trac 1.2.

comment:35 Changed 7 years ago by Ryan J Ollos

In 16335:

1.2.0: Prepare for release

Refs #13045.

comment:36 Changed 7 years ago by Ryan J Ollos

Published pypi:TracQuiet.

comment:37 Changed 7 years ago by Ryan J Ollos

In 16336:

1.2.0: Revise description

Refs #13045.

comment:38 in reply to:  9 Changed 7 years ago by Ryan J Ollos

Replying to Ryan J Ollos:

I wonder if there is a better way to implement this than overriding EmailDistributor. I don't know the notification API well enough yet, but I wonder if a notification subscriber could be used instead.

Better implementation proposed in #13117.

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'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.