Closed Bug 1191483 Opened 9 years ago Closed 9 years ago

Account manager pops up on wake if there are no autojoins

Categories

(Chat Core :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Instantbird 43

People

(Reporter: aleth, Assigned: aleth)

Details

Attachments

(1 file, 1 obsolete file)

STR
Use a profile with some connected accounts, none of which are set to autojoin.
Send your PC to sleep until the accounts disconnect.
They automatically reconnect on wake, but the account manager pops up too.
Attached patch noshowaccmgr.diff (obsolete) — Splinter Review
Waking from sleep, previously open connections may get disconnected, and the account-disconnected observer calls showAccountManagerIfNeeded if account.reconnectAttempt is still false at that point. Then, from that function, unless one of the other accounts is already (re)connecting or connected, the account manager will be shown.

We should simply add a short delay here so that the disconnect/reconnect sequence has sorted itself out by the time showAccountManagerIfNeeded is called.
Attachment #8656772 - Flags: review?(clokep)
Comment on attachment 8656772 [details] [diff] [review]
noshowaccmgr.diff

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

Interesting bug, thanks!

::: im/modules/ibCore.jsm
@@ +269,4 @@
>    observe: function(aSubject, aTopic, aData) {
>      if (aTopic == "account-disconnected") {
>        let account = aSubject.QueryInterface(Ci.imIAccount);
> +      if (account.reconnectAttempt || this._pendingShowAccountManager)

If you check _pendingShowAccountManager a line earlier you can avoid the QueryInterface call. It's a rare case though so up to you.

@@ +270,5 @@
>      if (aTopic == "account-disconnected") {
>        let account = aSubject.QueryInterface(Ci.imIAccount);
> +      if (account.reconnectAttempt || this._pendingShowAccountManager)
> +        return;
> +      // Wait a 300ms to be sure no automatic reconnections would still

I find this a bit difficult to understand, how about "Automatic reconnections (e.g. if the computer just woke up from sleep) might not have been triggered yet, wait 300ms for these before attempting to show the account manager."?
Attachment #8656772 - Flags: review?(clokep) → review+
r+ carried forward.
Attachment #8656811 - Flags: review+
Keywords: checkin-needed
Attachment #8656772 - Attachment is obsolete: true
https://hg.mozilla.org/comm-central/rev/e99501b47a9f75e91345b352745931d94b7d8c27
Bug 1191483 - Don't show account manager when reconnecting after waking from sleep. r=nhnt11
Assignee: nobody → aleth
Status: NEW → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Instantbird 43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: