The messages.query API fails when GloDa returns bad data
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr68 fixed, thunderbird71 fixed, thunderbird72 fixed)
People
(Reporter: mihaicodrean, Assigned: darktrojan)
Details
Attachments
(1 file, 1 obsolete file)
2.23 KB,
patch
|
darktrojan
:
review+
jorgk-bmo
:
approval-comm-beta+
mkmelin
:
approval-comm-esr68+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Steps to reproduce:
Called the WebExtensions "messages.query" API with the "folder" & "fromDate" filters.
Actual results:
The operation fails with:
messageList.getNext(...) is null ext-mail.js:1503
_getNextPage chrome://messenger/content/parent/ext-mail.js:1503
startList chrome://messenger/content/parent/ext-mail.js:1442
query chrome://messenger/content/parent/ext-messages.js:212
AsyncFunctionNext self-hosted:689
It seems that this is happening when the expected result is smaller than messagesPerPage (100).
Expected results:
Return the results.
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
This works for me, and our tests, so I don't think it's anything to do with the number of messages. I think it's more likely that one (or more) particular message is causing a problem, like if glodaMsg
for some reason didn't have a folderMessage
property here. Mihai, could you narrow it down to any particular message?
(In reply to Geoff Lankow (:darktrojan) from comment #1)
Mihai, could you narrow it down to any particular message?
I have tried with the "query" API instead of "list" and adjusted the "fromDate" parameter in a divide & conquer manner until narrowing it down to one day, for which I have a single message in that folder. However, I see nothing special about that message, although I should also check the DB for it.
I'm now rebuilding global-messages-db.sqlite, just to see if that's it - this is a lengthy process, because its size was 1.8 GB.
So you were right, it was Gloda related - rebuilding global-messages-db.sqlite did the trick. Thanks!
Do you think it's worth investigating any further (I still have the old global-messages-db.sqlite backed up), or just put it on DB corruption?
Assignee | ||
Comment 4•6 years ago
|
||
It's probably a bug that Gloda should never be in this state, and that might be worth investigating but I doubt it. This API should be fixed to handle the faulty data though. I suspect the only thing it can do is ignore the message.
Assignee | ||
Updated•6 years ago
|
(In reply to Geoff Lankow (:darktrojan) from comment #4)
It's probably a bug that Gloda should never be in this state, and that might be worth investigating but I doubt it.
Can provide me with the necessary SQLite query or relevant schema to check, based on the identified message (in the TB UI, I don't know it's DB ID), I will do it.
This API should be fixed to handle the faulty data though. I suspect the only thing it can do is ignore the message.
Makes sense to me.
Mihai> I have tried with the "query" API instead of "list" and adjusted the "fromDate" parameter in a divide & conquer manner until narrowing it down to one day, for which I have a single message in that folder. However, I see nothing special about that message, although I should also check the DB for it.
I have checked Gloda and I was able to locate the corresponding message by the Message-Id, in the following tables:
- messages
- messagesText_content
- conversations (by the conversationID from messages)
- conversationsText_content
- folderLocations.
But all looks normal to me. I don't know how to interpret the contents of messages.jsonAttributes though.
Geoff, shall I dig any further? If yes, please provide the steps.
Assignee | ||
Comment 7•6 years ago
|
||
You probably now know more about GloDa than I do. I haven't had time to look further into this yet, but I'll leave the NI? here to remind me to do so.
Assignee | ||
Comment 8•6 years ago
|
||
It looks like there's lots of reasons why folderMessage
could be null, so it definitely should be handled better. I suspect the reason your message is problematic is that it's somehow got disconnected from the folder it's really in, but I'm not going to investigate further.
Assignee | ||
Comment 9•6 years ago
|
||
This patch handles the situation two ways: it ignores null messages in a message list, and it prevents them being there in the first place (at least from this method).
Reporter | ||
Comment 10•6 years ago
|
||
Thanks. Shouldn't there be some error logging in place, so that one can be aware that an incomplete set of messages was returned? Or is that the Gloda API's responsibility?
Comment 11•6 years ago
|
||
Assignee | ||
Comment 12•6 years ago
|
||
How about this? (I blame Philipp for the use of Boolean!)
Assignee | ||
Comment 13•6 years ago
|
||
(In reply to Mihai from comment #10)
Thanks. Shouldn't there be some error logging in place, so that one can be aware that an incomplete set of messages was returned? Or is that the Gloda API's responsibility?
IMO that's up to Gloda. It either shouldn't be broken or it should tell you when it is.
Comment 14•6 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/97369b9ba582
Handle bad data in WebExt API message handling; r=mkmelin
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Comment 15•6 years ago
|
||
Assignee | ||
Comment 16•6 years ago
|
||
Okay.
Comment 17•6 years ago
|
||
TB 71 beta 4:
https://hg.mozilla.org/releases/comm-beta/rev/004fc2991ce3d1e1b6f7c85e4540f69e9812e4ab
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 18•6 years ago
|
||
Description
•