Multiple (master) password prompts on startup when using news authentication - Hook up NNTP to msgAsyncPrompt service

RESOLVED FIXED in Thunderbird 13.0

Status

MailNews Core
Networking: NNTP
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: standard8, Assigned: jcranmer)

Tracking

({regression})

Trunk
Thunderbird 13.0
regression
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

7 years ago
+++ This bug was initially created as a clone of Bug #560792 +++

Spinning out the separate work from bug 338549. We need to hook up NNTP to the msgAsyncPrompt service so that the prompts will occur in serial fashion.

I believe we'd hit this case very rarely, but we should still do it anyway at some stage.
(Reporter)

Updated

7 years ago
Blocks: 419354

Comment 1

7 years ago
We hit this case, if in folderpane a newsgroup was selected, when Thunderbird was closed. (Re-)opening Thunderbird than leads to multiple masterpassword dialogs.
(Reporter)

Updated

7 years ago
Summary: Hook up NNTP to msgAsyncPrompt service and make its password prompts serial again → Multiple (master) password prompts on startup when using news authentication - Hook up NNTP to msgAsyncPrompt service
(Reporter)

Updated

7 years ago
Duplicate of this bug: 570935
(Reporter)

Updated

7 years ago
No longer blocks: 419354
Duplicate of this bug: 419354
As said on my now duped bug, this is a regression. Adding keyword.
Keywords: regression

Updated

7 years ago
Duplicate of this bug: 571221

Comment 6

7 years ago
Every time I start Thunderbird I get the master password dialog twice. Once for mail and once for RSS feeds. (My news accounts don't load automatically at startup.) When I turn off "Check for new articles at startup" for the RSS feeds, I get the master password dialog only once. But I want to check these feeds only once a day, not every xx minutes, so I prefer to keep it the way I have it.

I found this bug through bug 570935, which more resembles my problem, but has been marked as a duplicate of this bug.

It worked better in TB 3.0 (as mentioned in comment 4).
(Reporter)

Updated

7 years ago
Duplicate of this bug: 590441

Comment 8

7 years ago
I have this problem too.  2 requests in a row for master password.

I have a master password set.  Additionally, I automatically download my gmail upon TB startup.  However, none of my newsgroup subscriptions are set to automatically download new messages upon startup (even though 1 of them requires a password each time I log in - I never get asked a 3rd time when I click on the name of that usenet service to download it's new messages).

Comment 9

7 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.14) Gecko/20100930 SeaMonkey/2.0.9

I don't know if it is this bug or bug #560792.  I get a prompt for my master password every time I launch SeaMonkey if the preference variable signon.startup.prompt has the default value of "true".  Thus, this is not a rare occurrence. 

I launch SeaMonkey only for the browser.  I don't use SeaMonkey's Mail-News capability and never open it.
(Reporter)

Comment 10

7 years ago
(In reply to comment #9)
> I launch SeaMonkey only for the browser.  I don't use SeaMonkey's Mail-News
> capability and never open it.

If you don't use mail-news and never set it up, then your issue is not likely to be a mailnews bug.

Comment 11

7 years ago
I'm using Thunderbird 3.1.5 and this happens at every log in.  It's annoying because it happens right at startup, before it's possible to preempt the problem by using Tools -> Options -> Security -> Saved Passwords to enter the password manually first.

Comment 12

7 years ago
Same problem here! TB 3.1.6, new profile, Email and news setup.
The only difference is that I have to enter the password three times, not only two.

Comment 13

7 years ago
It seems it is not necessary to enter the password on all prompts. After entering the password at the first prompt, the other dialog(s) can just be closed by pressing <Enter>.

Comment 14

7 years ago
If I do not enter all password "rapidly", the system hangs on Linux. This render this bug even more annoying.
(Reporter)

Updated

7 years ago
Duplicate of this bug: 593701

Comment 16

7 years ago
7 months after, it is still not fixed and still freezes the application if password are not entered rapidly enough. 

If only kmail was available on windows I would have moved away!

Comment 17

7 years ago
I found a workaround:

mail.server.default.login_at_startup -> true

mail.server.server3.login_at_startup -> false
mail.server.server4.login_at_startup -> false

mail.startup.enabledMailCheckOnce -> true

(am not sure that last one matters)

Comment 18

6 years ago
I have this problem too. The problem is not related with NNTP, it's just that TB opens as many prompts as passwords it needs at startup. I have a few mail accounts and lightning calendars and it opens as much as needed. It's like if TB tries to ask for the passwords concurrently instead of just a one and then lock waiting for the master password.

If you have an account that doesn't read mail automatically, when you read it, you don't have the problem, because when TB needs its password, you have previously (at startup) entered the master password.

I have the problem with TB 3.1.7 in linux (ubuntu package), but I'm getting since previous versions.

Comment 19

6 years ago
Nearly a year and a half and no progress. I still need to enter 3 passwd each time in start thunderbird. This is getting on my nerfs.

Comment 20

6 years ago
The good "news" is, it isn't really necessary to enter the master password multiple times (same for Firefox). Enter the master password once and press OK for all other prompts without entering anything.
(Assignee)

Updated

6 years ago
Assignee: nobody → Pidgeot18
Status: NEW → ASSIGNED
(Assignee)

Updated

6 years ago
Depends on: 201750
(Assignee)

Comment 21

6 years ago
Created attachment 582417 [details] [diff] [review]
Introduce nsNNTPProtocol to the async prompter

This patch also has a bit of cleanup (s/NEWS_FINISHED/NNTP_SUSPENDED/ to correct what the state actually means), and a lot more documentation (particularly about NNTP_SUSPENDED)--if you don't feel comfortable reviewing this, switch it to someone else.
Attachment #582417 - Flags: review?(mbanner)
(Assignee)

Updated

6 years ago
Duplicate of this bug: 271587
(Reporter)

Comment 23

5 years ago
Comment on attachment 582417 [details] [diff] [review]
Introduce nsNNTPProtocol to the async prompter

Review of attachment 582417 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/news/src/nsNNTPProtocol.cpp
@@ +2384,5 @@
>    nsCOMPtr<nsIMsgMailNewsUrl> mailnewsurl = do_QueryInterface(m_runningURL);
>    if (!m_msgWindow && mailnewsurl)
>      mailnewsurl->GetMsgWindow(getter_AddRefs(m_msgWindow));
>    bool validCredentials = false;
> +  rv = m_newsFolder->GetAuthenticationCredentials(m_msgWindow, false, false,

You can't do this here, it must be inside the prompter call. The reason being is that just accessing the login manager may cause the master password prompt to appear, and you need to be in async mode by that time.

I think with other protocols, we've generally checked the result value from GetPassword (stored in nsMsgIncomingServer iirc) to see if it is empty or not, if it is, then we've gone into the auth check. You could probably do similar here, but maybe with the username.

As this change may reflect on the other patch, I'll wait until you've taken a look before testing this out.
Attachment #582417 - Flags: review?(mbanner) → review-
(Assignee)

Comment 24

5 years ago
Reviewing the code manually seems to indicate that I was mentally overcompensating for bug 437930. If I make the async bit only a mayPrompt and not a mustPrompt, I don't need the mustNotPrompt here. Even though I could probably get by with only checking GetUsername, if I add support for having multiple Usenet accounts with the same server but different username, that would lead to a false positive. Patch pending while I think about bug 201750 some more.
(Assignee)

Comment 25

5 years ago
Created attachment 591980 [details] [diff] [review]
Updated patch

This should remove the password prompter issue, although I suspect I need some more work later on to finally fix bug 437930...
Attachment #582417 - Attachment is obsolete: true
Attachment #591980 - Flags: review?(mbanner)
(Reporter)

Comment 26

5 years ago
Comment on attachment 591980 [details] [diff] [review]
Updated patch

Unfortunately, test_uriParser.js is always failing with:

###!!! ASSERTION: nsNSSComponent relies on profile manager to wait for synchronous shutdown of all network activity: 'mIsNetworkDown', file /Users/moztest/comm/main/src/mozilla/security/manager/ssl/src/nsNSSComponent.cpp, line 2590
###!!! ASSERTION: nsNSSComponent relies on profile manager to wait for synchronous shutdown of all network activity: 'mIsNetworkDown', file /Users/moztest/comm/main/src/mozilla/security/manager/ssl/src/nsNSSComponent.cpp, line 2590

(at least on my mac).
(Assignee)

Comment 27

5 years ago
(In reply to Mark Banner (:standard8) from comment #26)
> ###!!! ASSERTION: nsNSSComponent relies on profile manager to wait for
> synchronous shutdown of all network activity: 'mIsNetworkDown', file
> /Users/moztest/comm/main/src/mozilla/security/manager/ssl/src/nsNSSComponent.
> cpp, line 2590
> ###!!! ASSERTION: nsNSSComponent relies on profile manager to wait for
> synchronous shutdown of all network activity: 'mIsNetworkDown', file
> /Users/moztest/comm/main/src/mozilla/security/manager/ssl/src/nsNSSComponent.
> cpp, line 2590


Hmm, that sounds like I need a while (gThreadManager.currentThread.hasPendingEvents()) before the .processNextEvent ?
(Reporter)

Comment 28

5 years ago
Unfortunately that doesn't work.
(Reporter)

Comment 29

5 years ago
Comment on attachment 591980 [details] [diff] [review]
Updated patch

Review of attachment 591980 [details] [diff] [review]:
-----------------------------------------------------------------

Weird, I just was retrying this to see if I could debug the failure, and with this additional patch it worked:

diff --git a/mailnews/news/test/unit/test_uriParser.js b/mailnews/news/test/unit/test_uriParser.js
--- a/mailnews/news/test/unit/test_uriParser.js
+++ b/mailnews/news/test/unit/test_uriParser.js
@@ -167,5 +167,7 @@ function run_test() {
   // The password migration is async, so trigger an event to prevent the logon
   // manager from trying to migrate after shutdown has started.
   var gThreadManager = Cc["@mozilla.org/thread-manager;1"].getService();
-  gThreadManager.currentThread.processNextEvent(true);
+  var thread = gThreadManager.currentThread;
+  while (thread.hasPendingEvents())
+    thread.processNextEvent(true);
 }

Not sure what I was doing wrong before.

::: mailnews/news/src/nsNewsFolder.cpp
@@ +1281,5 @@
>    }
>    NS_FREE_XPCOM_ISUPPORTS_POINTER_ARRAY(count, logins);
>    NS_ENSURE_SUCCESS(rv, rv);
>  
> +  // If there is nothing to migrate, then do othing

nit: othing -> nothing
Attachment #591980 - Flags: review?(mbanner) → review+
(Assignee)

Comment 30

5 years ago
Pushed: <http://hg.mozilla.org/comm-central/pushloghtml?changeset=841928c4a46c>.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 13.0

Updated

5 years ago
Depends on: 783479
You need to log in before you can comment on or make changes to this bug.