"Go to Gmail Account" button opens several web browser instances

Bug #184985 reported by Josh Headapohl
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cGmail
Fix Committed
Undecided
Marco Ferragina

Bug Description

When a new mail arrives, cGmail notifies me with a popup. There is a button to press to take me to my account. If I press it, it opens up not one but many Gmail tabs. My browser is Firefox, and I am running Ubuntu 7.10. If Firefox is already running, I end up with new tabs. If Firefox is not already open, more than one instance is started. One opens successfully and I get some messages that say Firefox is already running.

Revision history for this message
Nanley Chery (nanoman) wrote :

I can reproduce this problem in Hardy Heron.

Changed in cgmail:
status: New → Confirmed
Revision history for this message
Keithamus (keithamus) wrote :

Can reproduce with 0.5 in Hardy also. Happens around a dozen times for me, rendering the button useless.

Revision history for this message
Adam Heckler (adamheckler-deactivatedaccount) wrote :

I can confirm this for Ubuntu 7.10 64-bit.

Revision history for this message
macro182 (macro182) wrote :

It happens also in Epiphany browser...
and, by mistake, I've notice this bug on another post

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

I'm also experiencing this issue with cGmail 0.5 and Hardy Heron.

Marco Ferragina, is there any information that we could provide you to help track this one down?

Revision history for this message
Josh Headapohl (joshhead) wrote :

After looking at the problem a little more closely and trying to find where it is in the code, I've noticed a few details:

cGmail tries to open one browser for every notification window that has been shown.

For example, if cGmail has shown me 5 notifications, and I click "Go to Gmail Account," cGmail tries to open 5 browsers.

I think the problem is in lib/notify.py, maybe in the __init__ method of the Notifier class.

Revision history for this message
Josh Headapohl (joshhead) wrote :

Okay, I have created a patch for the 0.5 release. If you are only checking one mail account, this might fix the problem. If you are checking multiple accounts, the "Go to Gmail Account" button may sometimes take you to the wrong account, but at least it will only launch one browser.

My change doesn't truly fix the problem but maybe it will lead to a better solution. This is my first time submitting a patch somewhere, so please let me know if I should do something differently.

Revision history for this message
rocknrollme (rocknrollme) wrote :

I've got this exact same problem one my laptop : ubuntu gutsu 7.10 / firefox 3.0 beta 4

Revision history for this message
sceo (christopher-j-wells) wrote :

ubuntu 7.10 / FF3b5 / cgmail .5; same here. Using multiple accounts, one gmail.com, one gmail hosted Mine opens my gmail account then four instances of my hosted account.

Revision history for this message
thepumpkinkingx (thepumpkinkingx) wrote :

How exactly to I apply the patch? I'm pretty new to linux and was having the same issue with multiple instances of firefox opening. I tried using Ubuntu 7.10's search features and even tried googling for the location of notifier.py but can't find it to patch it. Help? Thanks. XD

Revision history for this message
Josh Headapohl (joshhead) wrote :

Hi. thepumpkinkingx, if you are still interested, notifier.py gets installed to /usr/lib/python2.5/site-packages/cGmail/lib/notifier.py. In this case, you can apply the patch directly to the installed file if you want. I'm not sure if it's a good idea, but here's how I would do it:

sudo patch -p3 -i not_exactly_fix.patch /usr/lib/python2.5/site-packages/cGmail/lib/notifier.py

Make sure you have cgmail 0.5.

Revision history for this message
mihai.ile (mihai.ile) wrote :

I can confirm in 0.5
It seems that if I open the same message 10 times it will open a new tab/window for every message that was shown.
I am using only one gmail account so I will try the patch proposed above.

I just wanted to alert that this bug is a showkiller for new cGmail users.
A fix should be made and a 0.5.1 version should be released...

Revision history for this message
David Rahrer (david-rahrer) wrote :

This happens to me as well on Hardy and FF 3. There doesn't seem to be any pattern on how many windows it opens, but it seems like they increase over time. It really is unusable at this point.

Revision history for this message
Dylan Thacker-Smith (dylan-smith) wrote :

I figured out the problem, and it should work for multiple accounts.

A new notification object is created for each notification window, and each one connects to the ActionInvoked signal. I found out that all the notifications objects were having their actions invoked, but they could keep track of an ID returned by the Notify method to make sure they only respond to actions on their window.

The code is still probably missing a close connection on this signal after the pop up disappears. Otherwise all these closed notifications wouldn't have having an affect.

I am not sure if this patch is in the right format. I haven't submitted patches to this project before, so let me know what the procedure is for submitting commits/patches.

Revision history for this message
Ismael Carnales (icarnales) wrote :

Dylan attached a patch for this bug, please review it and commit it :)

This bug is very annoying for a great app like this!

Changed in cgmail:
assignee: nobody → ferama
status: Confirmed → In Progress
Revision history for this message
Marco Ferragina (ferama) wrote :

Applied Ismael Carnales patch. Thanks

Changed in cgmail:
status: In Progress → Fix Committed
Revision history for this message
Ismael Carnales (icarnales) wrote :

All the credit goes to Dylan Smith, I've only assigned the bug to you Marco :)

Thanks for the quick review, and keep the good work.

Revision history for this message
Marco Ferragina (ferama) wrote :

Ops :) Sorry Dylan. Thanks for the patch

Revision history for this message
Adam Heckler (adamheckler-deactivatedaccount) wrote :

When I apply the patch with this command:

sudo patch -p3 -i open-browser-once.patch /usr/lib/python2.5/site-packages/cGmail/lib/notifier.py

I get the following error in the terminal:

"missing header for unified diff at line 15 of patch"

But it seems as if the patch is applied anyway. Can someone explain this?

Revision history for this message
quixote_arg (tulsidas) wrote :

patch works fine!

Revision history for this message
AbuYusuf (ahmed-hosny-eg) wrote :

last patch ( By: Dylan ) working and now it open one instance no more ..

Revision history for this message
vickoxy (vickoxy) wrote :

I added the patch: i have 2 Gmail accounts, and now almost everything works ok, but cgmail opens automatically only the first time opened account. So, for the second account i have to log out and log in manually. Can anyone tells if these bug are fixed (will be) because the application is very good? Btw, i have Dell Mini 9 with Ubuntu 8.04 (LPIA).
Still, with this programm does very good job-the most important is to have overview over multiple accounts...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.