Closed Bug 58713 Opened 24 years ago Closed 12 years ago

After delete an account the next account should be selected

Categories

(MailNews Core :: Account Manager, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 15.0

People

(Reporter: bugzilla, Assigned: aceman)

References

Details

(Whiteboard: [Halloween2011Bug])

Attachments

(1 file, 3 obsolete files)

If you have 5 accounts and delete number 4, number 1 is selected after the delete.
When you delete the next account should be selected.
So deleting number 4 out of 5 should select number 4 of out 4 af the delete.
Deleting number 4 out of 4 should select number 3 of out 3 af the delete.
etc. etc. etc...
QA Contact: esther → nbaca
mass re-assign of account manager bugs to racham.
Assignee: sspitzer → racham
Keywords: nsCatFood
Keywords: nsCatFoodnsCatFood-
Status: NEW → ASSIGNED
Target Milestone: --- → Future

*** This bug has been marked as a duplicate of 27417 ***
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Depends on: 27417
Resolution: --- → DUPLICATE
Verified Duplicate.
Status: RESOLVED → VERIFIED
Reopening because I believe this bug depends on bug# 27417. I also I don't want
to miss testing this case when 27417 is fixed.
Status: VERIFIED → REOPENED
Resolution: DUPLICATE → ---
mass re-assign.
Assignee: racham → sspitzer
Status: REOPENED → NEW
Product: Browser → Seamonkey
Assignee: sspitzer → mail
Priority: P3 → --
QA Contact: nbaca
Target Milestone: Future → ---
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
Status: NEW → UNCONFIRMED
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
MASS-CHANGE:
This bug report is registered in the SeaMonkey product, but still has no comment since the inception of the SeaMonkey project 5 years ago.

Because of this, we're resolving the bug as EXPIRED.

If you still can reproduce the bug on SeaMonkey 2 or otherwise think it's still valid, please REOPEN it and if it is a platform or toolkit issue, move it to the according component.

Query tag for this change: EXPIRED-20100420
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago14 years ago
Resolution: --- → EXPIRED
Assignee: mail → nobody
Status: RESOLVED → UNCONFIRMED
Component: MailNews: Account Configuration → Account Manager
Product: SeaMonkey → MailNews Core
QA Contact: account-manager
Resolution: EXPIRED → ---
Still valid when deleting accounts which are not the first one in the tree.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [Halloween2011Bug]
I'll try to look.
Assignee: nobody → acelists
Confirming, it always selects the top one. I'll try to fix this.

Usul, could you please hide the duplicate comment 7 to comment 11 to clean up this bug?
OK, I have a working patch ready but need to wait until bug 740617 lands as it touches the same function.
Depends on: 740617
Attached patch patch (obsolete) — Splinter Review
But let's collect some reviews in the mean time.
Attachment #614193 - Flags: ui-review?(bwinton)
Attachment #614193 - Flags: review?(iann_bugzilla)
Status: NEW → ASSIGNED
Blocks: 274452
Comment on attachment 614193 [details] [diff] [review]
patch

I'm pretty happy with this behaviour.  ui-r=me.

Oh, and I'ld like to see some tests, of course.  ;)

Thanks,
Blake.
Attachment #614193 - Flags: ui-review?(bwinton) → ui-review+
I'd like to see some too! :)
Flags: in-testsuite?
Comment on attachment 614193 [details] [diff] [review]
patch

I presume moving to Services.jsm/mailServices.js is in another bug?

>     dump("failure to remove account: " + ex + "\n");
Would we want to use reportError rather than dump here?

r=me with those answered/addressed.
Attachment #614193 - Flags: review?(iann_bugzilla) → review+
Yes, that onRemoveAccount function is already moved to Services in bug 740617 (the patch is already bitrotted :)) Moving the rest of the file is bug 738810.
Attached patch patch v2 (obsolete) — Splinter Review
Thanks, fixed, plus a bit of planned bitrot.
Attachment #614193 - Attachment is obsolete: true
Attachment #618025 - Flags: review?(mconley)
Comment on attachment 618025 [details] [diff] [review]
patch v2

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

::: mailnews/base/prefs/content/AccountManager.js
@@ +509,5 @@
> +  let serverIndex = serverList.indexOf(server);
> +
> +  // After the current server is deleted, choose the next server/account,
> +  // or the previous one if the last one was deleted.
> +  if (serverIndex == serverList.length - 1)

Suppose we only have one server, and we've removed it.

So serverIndex = 0, serverList.length = 1.

serverIndex == serverList.length - 1

We then run serverIndex--, so serverIndex is now -1.  And then we try to access serverList[-1], which doesn't make much sense.

We should definitely handle that case.

@@ +529,3 @@
>    }
>    catch (ex) {
> +    Components.utils.reportError("failure to remove account: " + ex + "\n");

The \n isn't needed.

@@ +532,2 @@
>      let alertText = bundle.getString("failedRemoveAccount");
>      Services.prompt.alert(window, null, alertText);;

While you're here - can you remove the double semi-colon?
(In reply to Mike Conley (:mconley) from comment #23)
> ::: mailnews/base/prefs/content/AccountManager.js
> We then run serverIndex--, so serverIndex is now -1.  And then we try to
> access serverList[-1], which doesn't make much sense.
> 
> We should definitely handle that case.
OK, I can support that ofr safety. But I think it is currently unrealistic as the Local Folders can't be removed. But maybe it is possible to not have them.
Attached patch patch v3 (obsolete) — Splinter Review
Attachment #618025 - Attachment is obsolete: true
Attachment #619286 - Flags: review?(mconley)
Attachment #618025 - Flags: review?(mconley)
Comment on attachment 619286 [details] [diff] [review]
patch v3

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

Just one last thing.  Beyond that, r=me.

Great job, as usual!

::: mailnews/base/prefs/content/AccountManager.js
@@ +524,5 @@
>      if (serverId in accountArray) {
>        delete accountArray[serverId];
>      }
> +
> +    if (serverIndex >= 0)

Maybe I'm being paranoid, but I'd also like a final check to ensure that serverIndex < serverList.length.
Attachment #619286 - Flags: review?(mconley) → review+
Attached patch patch v4Splinter Review
Thanks.
Attachment #619286 - Attachment is obsolete: true
Attachment #619638 - Flags: review+
Keywords: checkin-needed
http://hg.mozilla.org/comm-central/rev/ddd7afa181b2
Status: ASSIGNED → RESOLVED
Closed: 14 years ago12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 15.0
Blocks: 815283
Tests checked in.
https://hg.mozilla.org/comm-central/rev/0cf5688a02e9
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: