Closed Bug 1704161 Opened 3 years ago Closed 3 years ago

Autocomplete broken in Thunderbird 78.9.1 after downgrade from recent Thunderbird beta.

Categories

(Thunderbird :: Message Compose Window, defect)

defect

Tracking

(thunderbird_esr78+ fixed, thunderbird89 affected)

RESOLVED FIXED
90 Branch
Tracking Status
thunderbird_esr78 + fixed
thunderbird89 --- affected

People

(Reporter: whimboo, Assigned: darktrojan)

References

Details

(Keywords: regression)

Attachments

(2 files)

Thunderbird 78.9.1 (64-bit) on MacOS 11.2.3

I recently tried to use Thunderbird beta with my daily profile but after a while I noticed that some addons don't work yet, and downgraded to 78 again.

Since this downgrade the address auto-completion does no longer work in the compose window. Also sometimes the contact sidebar shows no entries for local address books. But there doesn't seem to be any connection between those two issues given that auto-complete never works. This behavior makes it currently nearly impossible to use Thunderbird because manually searching and copying addresses is required.

By default all addresses are stored in my MacOS address book, and that one has been set as primary address book.

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #0)

Thunderbird 78.9.1 (64-bit) on MacOS 11.2.3

I recently tried to use Thunderbird beta with my daily profile but after a while I noticed that some addons don't work yet, and downgraded to 78 again.

I want to double check this statement - by "daily profile" you mean your production profile, but you're not saying use used this profile with a nightly build?

Flags: needinfo?(hskupin)

That's correct. I used it with 78 before, then beta, and back to 78. A nightly version was never in use.

Also running in safe mode didn't make a difference.

Flags: needinfo?(hskupin)

@Henrik
in Thunderbird open Address Book and in menu File verify if "Use Mac OS X Address Book" is checked.
Also open the macOS System Preferences > Security & Privacy > Privacy and verify if Thunderbird is authorized to access your "Contacts" (which corresponds to what Thunderbird calls the "Mac OS X Address Book").

The address book is just fine and lists my addresses. Only the compose window is affected, and it all started with the upgrade and downgrade. Before that moment everything was working fine. Checking all the items you mentioned seconds that all is properly setup.

Actually whenever I add a letter into the To field I can see the following failure in the DevTools console:

NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement] AddrBookDirectory.jsm:222
    get _cards resource:///modules/AddrBookDirectory.jsm:222
    search resource:///modules/AddrBookDirectory.jsm:612
    _searchCards resource:///modules/AbAutoCompleteSearch.jsm:208
    _searchCards resource:///modules/AbAutoCompleteSearch.jsm:207
    startSearch resource:///modules/AbAutoCompleteSearch.jsm:465

You can't downgrade from beta to 78 ESR without losing the address books, see bug 1701996 comment #8 and below.

Ok, so that is clear now. But restoring the old (backups) doesn't work. Also removing the Mac address book and adding it again the same failures persist. Maybe there are some preferences that also changed their values?

Hmm, when I run TB 78 on a beta profile I get exactly that:
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement]
The code in question, via the error console, is a "this._dbConnection.createStatement()". And that fails since the DB schema has changed. That should be fixed following bug 1701996 comment #10. You need to rename the .v2 files, not put the .bak files back. Prefs changed between TB 68 and TB 78 pointing to the new SQLite-based ABs, but not from 78 to later betas. The Mac AB is really unrelated, here your SQLite access to the local AB fails.

(In reply to José M. Muñoz from comment #8)

You need to rename the .v2 files, not put the .bak files back.

That's exactly what I did. Closing Thunderbird, removing the .sqlite files, and renaming the .v2 files.

The Mac AB is really unrelated, here your SQLite access to the local AB fails.

Why? Removing the address book will also remove the file from disk, or (I explicitly haven't checked that)? And re-connecting to the MacOS addressbook will create a new address book, and that should be in the correct sqlite schema version. But it's still failing.

Let's ask the developer. I thought the read-only(!) Mac AB is accessed on the fly with no local storage. Also, there will an issue when people will try to revert from the future 91 ESR to 78 ESR.

Flags: needinfo?(geoff)

If you've put the v2 files back in place of the v3 files I don't see how that could be failing, but it looks like it is. There should be (but isn't) a try/catch around the search to prevent one failing directory from taking out the whole search. Does removing abook.sqlite and history.sqlite altogether make the problem go away?

Flags: needinfo?(geoff)

Ah! I actually missed to restore both of these files. So after replacing them with the .v2 equivalents it clearly fixed my problem. Thanks!

still, autocomplete should not fail?

I mean, not totally fail, if at least one address book is available?
What about sidebar?
And are all the errors exposed in error console?

Autocomplete searches the ABs, including Mac AB and even Outlook AB of so configured. If the local AB is "incompatible", that search will fail. As Geoff said (quote): "There should be (but isn't) a try/catch around the search to prevent one failing directory from taking out the whole search". So maybe use the bug to add that try/catch. The consequence will be that it will silently fail, so maybe perhaps some error? "Can't access AB foo".

I'll make the change to catch and log the error.

Assignee: nobody → geoff
Status: NEW → ASSIGNED

A failure in one address book should no break the whole search. Catch the failure, report it, and move on.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/9ea2210f7da1
Reinstate try/catch in address book autocomplete loop. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
See Also: → 1708369

Comment on attachment 9217678 [details]
Bug 1704161 - Reinstate try/catch in address book autocomplete loop. r?mkmelin

[Approval Request Comment]
Regression caused by (bug #): bug 1633620
User impact if declined: one broken address book breaks auto-complete for others
Testing completed (on c-c, etc.): on c-c for a month
Risk to taking this patch (and alternatives if risky): not risky

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

Comment on attachment 9217678 [details]
Bug 1704161 - Reinstate try/catch in address book autocomplete loop. r?mkmelin

[Triage Comment]
We don't have another beta for 89, so this will appear in beta 90.

Attachment #9217678 - Flags: approval-comm-beta? → approval-comm-beta-

Comment on attachment 9217678 [details]
Bug 1704161 - Reinstate try/catch in address book autocomplete loop. r?mkmelin

[Triage Comment]
simple patch, and been on nightly for long, so approving for esr78

Attachment #9217678 - Flags: approval-comm-esr78? → approval-comm-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: