Note: There are a few cases of duplicates in user autocompletion which are being worked on.

After delete an account the next account should be selected

RESOLVED FIXED in Thunderbird 15.0

Status

MailNews Core
Account Manager
RESOLVED FIXED
17 years ago
5 years ago

People

(Reporter: Henrik Gemal, Assigned: aceman)

Tracking

(Depends on: 1 bug)

Trunk
Thunderbird 15.0
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Halloween2011Bug])

Attachments

(1 attachment, 3 obsolete attachments)

2.60 KB, patch
aceman
: review+
Details | Diff | Splinter Review
(Reporter)

Description

17 years ago
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...

Updated

17 years ago
QA Contact: esther → nbaca
mass re-assign of account manager bugs to racham.
Assignee: sspitzer → racham

Updated

17 years ago
Keywords: nsCatFood

Updated

17 years ago
Keywords: nsCatFood → nsCatFood-

Updated

16 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → Future

Comment 2

16 years ago

*** This bug has been marked as a duplicate of 27417 ***
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Depends on: 27417
Resolution: --- → DUPLICATE

Comment 3

16 years ago
Verified Duplicate.
Status: RESOLVED → VERIFIED

Comment 4

16 years ago
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

Updated

12 years ago
Assignee: sspitzer → mail
Priority: P3 → --
QA Contact: nbaca
Target Milestone: Future → ---

Comment 6

8 years ago
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

Comment 7

8 years ago
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

Comment 8

8 years ago
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

Comment 9

8 years ago
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

Comment 10

8 years ago
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

Comment 11

8 years ago
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

Comment 12

7 years ago
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
Last Resolved: 16 years ago7 years ago
Resolution: --- → EXPIRED

Updated

6 years ago
Assignee: mail → nobody
Status: RESOLVED → UNCONFIRMED
Component: MailNews: Account Configuration → Account Manager
Product: SeaMonkey → MailNews Core
QA Contact: account-manager
Resolution: EXPIRED → ---

Comment 13

6 years ago
Still valid when deleting accounts which are not the first one in the tree.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [Halloween2011Bug]
(Assignee)

Comment 14

5 years ago
I'll try to look.
Assignee: nobody → acelists
(Assignee)

Comment 15

5 years ago
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?
(Assignee)

Comment 16

5 years ago
OK, I have a working patch ready but need to wait until bug 740617 lands as it touches the same function.
Depends on: 740617
(Assignee)

Comment 17

5 years ago
Created attachment 614193 [details] [diff] [review]
patch

But let's collect some reviews in the mean time.
Attachment #614193 - Flags: ui-review?(bwinton)
Attachment #614193 - Flags: review?(iann_bugzilla)
(Assignee)

Updated

5 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

5 years ago
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+
(Assignee)

Comment 19

5 years ago
I'd like to see some too! :)
Flags: in-testsuite?

Comment 20

5 years ago
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+
(Assignee)

Comment 21

5 years ago
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.
(Assignee)

Comment 22

5 years ago
Created attachment 618025 [details] [diff] [review]
patch v2

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?
(Assignee)

Comment 24

5 years ago
(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.
(Assignee)

Comment 25

5 years ago
Created attachment 619286 [details] [diff] [review]
patch v3
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+
(Assignee)

Comment 27

5 years ago
Created attachment 619638 [details] [diff] [review]
patch v4

Thanks.
Attachment #619286 - Attachment is obsolete: true
Attachment #619638 - Flags: review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
http://hg.mozilla.org/comm-central/rev/ddd7afa181b2
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago5 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 15.0
(Assignee)

Updated

5 years ago
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.