Closed Bug 1783573 Opened 3 years ago Closed 6 months ago

nsIMsgAsyncPrompter.queueAsyncAuthPrompt() prompts should auto-cancel upon shutdown?

Categories

(MailNews Core :: Networking: IMAP, task)

task

Tracking

(thunderbird_esr140 wontfix, thunderbird145 wontfix)

RESOLVED FIXED
146 Branch
Tracking Status
thunderbird_esr140 --- wontfix
thunderbird145 --- wontfix

People

(Reporter: benc, Assigned: mkmelin)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

(Following on from Bug 1629669)

I don't think async prompts are cancelled when shutdown occurs.

Example:
The IMAP protocol thread calls nsImapIncomingServer::AsyncGetPassword() on the main thread to get a password. If the password is not set, this means popping up an async password prompt for the user (the IMAP protocol object is passed in as the listener - it implements nsIMsgAsyncPromptListener.

If shutdown occurs while the prompt is up, experience from Bug 1629669 suggests the listener is never informed. It should be!
Probably just by calling onPromptCanceled() on the listener.

For Bug 1629669 the proposed fix is to add an explicit check for shutdown, but really, the check for NS_MSG_PASSWORD_PROMPT_CANCELLED (set by the onPromptCanceled() handler) should be enough to break out of the loop.

(In reply to Ben Campbell from comment #0)

(Following on from Bug 1629669)

I don't think async prompts are cancelled when shutdown occurs.
...
For Bug 1629669 the proposed fix is to add an explicit check for shutdown, but really, the check for NS_MSG_PASSWORD_PROMPT_CANCELLED (set by the onPromptCanceled() handler) should be enough to break out of the loop.

That is now the "implemented fix", correct? So, IS the NS_MSG_PASSWORD_PROMPT_CANCELLED (set by the onPromptCanceled() handler) enough to break out of the loop, as you inquired above? If so, is there a patch for that?

No longer blocks: 1629669
Depends on: 1629669
Flags: needinfo?(toby)
See Also: 1629669

Hey Geoff, could your fix for bug 1934491 be used to address this? (#1 crash)

Flags: needinfo?(toby) → needinfo?(geoff)

(In reply to Toby Pilling [:tobyp] from comment #3)

Hey Geoff, could your fix for bug 1934491 be used to address this? (#1 crash)

Footnote, bug 1934491 had two regressions reported.

See Also: → 1934491

(In reply to Ben Campbell from comment #0)

I don't think async prompts are cancelled when shutdown occurs.

Seems they are though, at least now.
Was going to try have an "quit-application" observer while doing _promiseAuthPrompt() in run(). But, if I quit (from another window), that promise already gets resolved. So nothing to do I think.
But I'll attach the modernization I did while looking at this.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Target Milestone: --- → 146 Branch

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/1fb337050145
Modernize MsgAsyncPrompter.sys.mjs. r=BenC

Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED

status-thunderbird145: --- → fixed
Target Milestone: --- → 146 Branch

Magnus, did you intend status-thunderbird145 to be wontfix?

Flags: needinfo?(mkmelin+mozilla)

Yes, ended up with just cleanup in this bug. I could not reproduce the original issue.

Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(geoff)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: