removing query attributes from gloda - which are allowed now? (refer to Jonathan's anouncement of 2011)

Andrew Sutherland asutherland at asutherland.org
Tue Mar 7 22:42:49 UTC 2017


First, kudos on digging into all of this.  You are a rare, brave spirit!

The starred attribute is propagated by the indexer:
https://dxr.mozilla.org/comm-central/source/mailnews/db/gloda/modules/explattr.js#141

It's using the nsIMsgHdr.isFlagged accessor:
https://dxr.mozilla.org/comm-central/source/mailnews/base/public/nsIMsgHdr.idl#28

What you're doing really should be working.  I wonder if there could be
a regression related to the iterator changes that happened at some
point?

Specifically, in my database, using Ubuntu's TB 45.7.0, the following
works out okay for me (and I previously confirmed attribute 58 is star
in my database too) with a freshly starred message:
sqlite> .header on
sqlite> select * from messageAttributes WHERE attributeID = 58 AND value
= 1 ORDER BY messageID DESC LIMIT 1;
conversationID|messageID|attributeID|value
121242|501116|58|1
sqlite> select * from messages WHERE id=501116;
id|folderID|messageKey|conversationID|date|headerMessageID|deleted|jsonAttributes|notability
501116|2|62743|121242|1488925968000000|8b973486-2171-9d56-4e58-e38cc443936a at mozilla.com|0|{"43":5137,"44":[17],"45":[],"46":[],"50":false,"51":[],"52":[5137,17],"53":[17],"56":[17],"57":[],"58":true,"59":true,"60":false,"61":false}|24

That is on an IMAP account, but POP3 should perform similarly since the
information is starred in the .msf file and also should be reflected
into the mbox file on disk if Thunderbird wrote the mbox file. 
(Thunderbird leaves space-padded header lines that it can update in
place as metadata changes.)

I think my best suggestion is to try a build that lines up with my
45.7.0 to sanity check.

Andrew

On Tue, Mar 7, 2017, at 04:45 PM, opto at optosolar.com wrote:
> Andrew - many thanks, that is very helpful.
> 
> Why can't I search for starred messages?
> I display the collection in a glodalist (and also
> alert(collection.items.length)).
> query.tags(tagArray[1]) works, same for query.bodyMatches("xx").
> 
> query.starred(true) returns empty list, query.starred(false) returns a
> subset of the unstarred messages. (all in the onQueryCompleted).
> 
> globals.messages.sqlite gives:
> table attributeDefinitions: has id 58 for star.
> table messagesAttributes has no entry for attributeID==58 with value 1
> (would that be expected, or are all those ==1 which are not ==0?)?
> 
> A starred message (in 3 pane view messagelist) identified by
> headerMessageID in table messages has 58:false in jsonAttributes.
> Assuming messageKey in table messages == messageID in table
> attributeDefinitions, attributeID 58 is set to 0 there for this message,
> so both tables seem to be consistent.
> 
> Still: the messagelist in 3 pane view shows the star. Where does that
> come from?
> 
> What is going on, is this misunderstanding on my side?
> 
> All on a development TB set up in August (at least that is date of
> localfolders directory in profile), with just 100 test messages from a
> POP3 account.
> 
> Klaus
> 
> _______________________________________________
> tb-planning mailing list
> tb-planning at mozilla.org
> https://mail.mozilla.org/listinfo/tb-planning


More information about the tb-planning mailing list