Last Comment Bug 871326 - archive settings made for identities are not saved
: archive settings made for identities are not saved
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Account Manager (show other bugs)
: 17
: All All
: -- normal (vote)
: Thunderbird 24.0
Assigned To: :aceman
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-12 15:46 PDT by freak-odo
Modified: 2013-06-25 05:22 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (1.57 KB, patch)
2013-05-23 09:53 PDT, :aceman
iann_bugzilla: review+
Details | Diff | Splinter Review

Description freak-odo 2013-05-12 15:46:12 PDT
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130409194949

Steps to reproduce:

1. open account settings
2. go to "Manage Identities"
3. select second (non-default) identity
4. switch to "Copies & Folders" tab
5. enable message archive
6. confirm with ok

additional information:
- the default-identity of that account got archiving enabled and working
- no errors are logged


Actual results:

the settings didn't apply. it is not possible to archive messages send to that specific identity. reopening the settings confirmed that they were back to default values.


Expected results:

the settings should have stuck
Comment 1 freak-odo 2013-05-18 03:10:27 PDT
edit: contrary to what I wrote before, it doesn't even matter which identity is selected, the settings are not saved for any identity
Comment 2 freak-odo 2013-05-18 04:31:58 PDT
here is a workaround:

1. open config-editor
2. search for "archive_enabled", you'll find the archive flags for all your identities in the form of mail.identity.id1.archive_enabled
3. enable archiving for the identities in question
4. if you need further configuration of the archive folders you can do it through the normal dialogues as explained in the first post, since the only thing not working in those dialogues is the enable/disable-flag

on a side note, this also suggest the bug is a fairly simple one, it seems the dialogue just ignores the enable-checkbox when saving the settings
Comment 3 :aceman 2013-05-23 00:55:24 PDT
Confirming, I see exactly the same. Only the enabled/disable checkbox is not saved, the target folders are.
Comment 4 :aceman 2013-05-23 01:25:54 PDT
Ok, the fix seems to be to add
  identity.archiveEnabled = document.getElementById('identity.archiveEnabled').checked;

to
function saveCopiesAndFolderSettings(identity)

in am-indentity-edit.js

I just wonder why it works for the default identity even without the fix.
Comment 5 freak-odo 2013-05-23 03:37:38 PDT
(In reply to :aceman from comment #4)
> I just wonder why it works for the default identity even without the fix.

It doesn't. If you try to edit the default identity through the identities dialogue, it doesn't work.
Or are you referring to the Copies&Folders Page directly in the account settings (not going through identities)? Do both pages share the same code?
Comment 6 :aceman 2013-05-23 05:22:36 PDT
(In reply to freak-odo from comment #5)
> (In reply to :aceman from comment #4)
> > I just wonder why it works for the default identity even without the fix.
> 
> It doesn't. If you try to edit the default identity through the identities
> dialogue, it doesn't work.
True.

> Or are you referring to the Copies&Folders Page directly in the account
> settings (not going through identities)? Do both pages share the same code?

Yes, I meant this one. And they share some code, but not all.
Comment 7 :aceman 2013-05-23 09:53:32 PDT
Created attachment 753344 [details] [diff] [review]
patch
Comment 8 WADA 2013-05-25 22:14:25 PDT
(In reply to :aceman from comment #7)
> patch

FYI.

By patch, primary identity's archiveEnabled can be changed via "per identity Copies&Folders panel" in addition to "primary Copies&Folders panel", and ArchiveEnabled of no-primary identity can be modified.

However, in determiation of "Do Archive for an account or not" is perhaps determined by archiveEnabled flag of pimary identity(first identity) of an account(server).
> http://mxr.mozilla.org/comm-central/source/mailnews/imap/src/nsImapIncomingServer.cpp#1425
> 1425 NS_IMETHODIMP nsImapIncomingServer::DiscoveryDone()
> 1449     rv = accountMgr->GetFirstIdentityForServer(this, getter_AddRefs(identity));
> 1451     {
> 1469       bool archiveEnabled;
> 1470       identity->GetArchiveEnabled(&archiveEnabled);
This is why;
(1) Concept of Archive was initiallly "per account".
    To specifiy Archives Folder, Copies&Folder panel is used.
    => archiveEnabled is saved via main Copies&Folders panel. 
(2) Because Copies&Folders tab exists in "per identity setting",
    per "identity Archive settings" is posible.
    And, any Archive setting except archiveEnabled can be changed
    and saved normally via the "per identity setting panel".
(3) Although non first identity's archive setting(folder, granularity)
    is used via getIdentityForHeader(),
> http://mxr.mozilla.org/comm-central/source/mail/base/content/mailCommands.js#53
    as seen in bug 819392, when multiple mails are selected at thread
    pane, "archive setting for MsgDBHdr of currently seleced mail in
    selected multiple mails" is applied to all selected mails.
    This is perhaps because Archive setting was "per account thing",
    even though it's set via Copies&Folders panel which is for
    "per identity setting".
 
Above issue is different issue from this bug, and above issue is irrelevant to this bug.
However, if different archiveEnabled can be set by this patch, following Tb's bug(for general user) will be surely generated.
  Even though Archive is disabled for third identity,
  mail to third ientity is still archived.
I think "Graying out Enable/Diable Archive check box at per identity Copes&Folders panel" is safer, untill "Archive is per identity thing" will be achived well in entire Thunderbird.
Comment 9 Ryan VanderMeulen [:RyanVM] 2013-05-28 10:17:33 PDT
https://hg.mozilla.org/comm-central/rev/0adefea2d5bd

Note You need to log in before you can comment on or make changes to this bug.