Closed Bug 1646529 Opened 4 years ago Closed 4 years ago

Unable to cancel / change Adaptive Junk Mail settings

Categories

(Thunderbird :: Account Manager, defect)

defect

Tracking

(thunderbird_esr68 affected, thunderbird_esr78 fixed, thunderbird78 affected)

VERIFIED FIXED
Thunderbird 79.0
Tracking Status
thunderbird_esr68 --- affected
thunderbird_esr78 --- fixed
thunderbird78 --- affected

People

(Reporter: admin, Assigned: khushil324)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [regression:tb71?])

Attachments

(2 files, 3 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0

Steps to reproduce:

"Enable Adaptive Junk Mail Controls for this account" is ticked.
I clear the tick.
I move to another setting (e.g. Composition and Addressing).
I return to Junk settings.

Actual results:

The tick reappears.
The Do Not Automatically tick boxes remain ticked.

Expected results:

If the Enable Adaptive tick box is cleared it should remain cleared.

Component: Untriaged → Account Manager
Summary: Unable to cancel Adaptive Junk Mail settings → Unable to cancel / change Adaptive Junk Mail settings

Maybe caused by the move of AM into a tab?
Something's wrong with https://searchfox.org/comm-central/rev/b0826913e4dd6d1913c9974fcc4dcf89a29a6f6b/mailnews/base/prefs/content/am-junk.js#159 - Khushil, please take a look.

Assignee: nobody → khushil324
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Attached patch Bug-1646529_fix-spam-checkbox-0.patch (obsolete) (deleted) — Splinter Review
Attachment #9158907 - Flags: review?(mkmelin+mozilla)
Status: NEW → ASSIGNED
Attached patch Bug-1646529_fix-spam-checkbox-1.patch (obsolete) (deleted) — Splinter Review
Attachment #9158907 - Attachment is obsolete: true
Attachment #9158907 - Flags: review?(mkmelin+mozilla)
Attachment #9158914 - Flags: review?(mkmelin+mozilla)

Can you explain the fix?

<checkbox checked="false"> was behaving as checkbox being checked, same as HTML behavior for hidden. So we need to use setAttribute or removeAttribute. Or we can use document.getElementById("server.spamLevel.visible").ckecked = document.getElementById("server.spamLevel").value > 0;

So here, I am setting the checked attrbiute whenever there document.getElementById("server.spamLevel").value > 0 else doing nothing which is equivalent to not check.

nice catch.

And we have several SUMO reports - and some bug reports https://mzl.la/3fT2I5H - involving problems with changing settings in preferences and accounts. I wonder if it would be easy to do a code audit to find problems similar to this bug? Or maybe junk is the only one

David, is this something you have also seen in version 68? Or do you only run beta?

Flags: needinfo?(admin)

Beta, because 64-bit (win 10)
HTH

Flags: needinfo?(admin)

Magnus, it seems that XUL Checkbox are now HTML:input type="checkbox". Do you know any such changes?

It is also using setAttribute and removeAttribute. But I think we should switch to: document.getElementById("server.spamLevel.visible").ckecked = document.getElementById("server.spamLevel").value > 0;. I will change that.

Comment on attachment 9158914 [details] [diff] [review] Bug-1646529_fix-spam-checkbox-1.patch Review of attachment 9158914 [details] [diff] [review]: ----------------------------------------------------------------- Yeah checked should be assigned for both cases.
Attachment #9158914 - Flags: review?(mkmelin+mozilla)
Attachment #9158914 - Attachment is obsolete: true
Attachment #9159164 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9159164 [details] [diff] [review] Bug-1646529_fix-spam-checkbox-2.patch Review of attachment 9159164 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, r=mkmelin
Attachment #9159164 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → Thunderbird 79.0

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/544c18f0eed3
Fix unable to change Adaptive Junk Mail settings. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

Looks like this is causing test failures for comm/mail/test/browser/account/browser_abWhitelist.js

Flags: needinfo?(khushil324)

Yes, it will be quick fix. Submiting a follow up patch ASAP.

Flags: needinfo?(khushil324)
Comment on attachment 9159649 [details] [diff] [review] Bug-1646529_followup-test-failure-browser_abWhitelist-0.patch Review of attachment 9159649 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/test/browser/account/browser_abWhitelist.js @@ +76,4 @@ > // the two default address books (Personal and Collected) displayed > let list = doc.getElementById("whiteListAbURI"); > Assert.equal( > + 3, why is this now three? Per the comments above shoud be two
Attachment #9159649 - Flags: review?(mkmelin+mozilla)

There are three address books listed in the box so it should be three only: Personal and Collected and MacOS Adress Book. If you run it locally, without both the patches, you will see the error. I don't know why we are not seeing that error on the Tree herder.

There was an unexpected number of address books - 2 == 3 - JS frame :: chrome://mochitests/content/browser/comm/mail/test/browser/account/browser_abWhitelist.js :: subtest_check_whitelist_init_and_save :: line 78

Without both the patches.

Attachment #9159649 - Attachment is obsolete: true
Attachment #9159704 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9159704 [details] [diff] [review] Bug-1646529_followup-test-failure-browser_abWhitelist-1.patch Review of attachment 9159704 [details] [diff] [review]: ----------------------------------------------------------------- Yeah I think osx address book is disabled for the mochitests.
Attachment #9159704 - Flags: review?(mkmelin+mozilla) → review+

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/c122925c73bc
Follow-up: fix test failure in browser_abWhitelist.js. r=mkmelin

Have we identified the regressor?

Flags: needinfo?(khushil324)

I think the issue was regressed by mozilla-central changes, not ours, mainly de-xbl of checkbox element.

Flags: needinfo?(khushil324)

Thanks. So in the m-c remove-XBL period of time, mostly Nov'19 to Jan'20 - so for thunderbird beta 70-72 period. Which matches my bug 1619046 which I think was already happening for several weeks before I filed the bug.

I can verify that the setting now sticks. I wonder if it also helps whatever was causing Bug 1529443 reported in version 60 - "Enable adaptive junk mail controls for this account" checkbox does not maintain state (tristate?)

Status: RESOLVED → VERIFIED
Whiteboard: [regression:tb71?]

And version 68 reported Bug 1607613 - Tools - Account Settings - Junk Settings - Select and Toggle Broken

It gets regressed here: Bug 1475817. The changes I made and lines causing the problems were from this bug. I don't why it's working in ESR68.

Yeah, that's odd. If the cause is bug 1475817 then version 68 should be affected.

Comment on attachment 9159164 [details] [diff] [review]
Bug-1646529_fix-spam-checkbox-2.patch

[Approval Request Comment]
Pretty safe regression fix.

Attachment #9159164 - Flags: approval-comm-esr78?
Attachment #9159164 - Flags: approval-comm-beta?

Comment on attachment 9159164 [details] [diff] [review]
Bug-1646529_fix-spam-checkbox-2.patch

[Triage Comment]
Approved for beta
Approved for esr78

Attachment #9159164 - Flags: approval-comm-esr78?
Attachment #9159164 - Flags: approval-comm-esr78+
Attachment #9159164 - Flags: approval-comm-beta?
Attachment #9159164 - Flags: approval-comm-beta+

Push to beta?

Flags: needinfo?(rob)

It's been on what's beta beta since long (landed 2 months ago). I had missed the time when requesting approvals.

Flags: needinfo?(rob)
Attachment #9159164 - Flags: approval-comm-beta+

Sorry, missed that, but then, I can't clear the flag any more :-(

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

Attachment

General

Created:
Updated:
Size: