Closed Bug 1781134 Opened 3 years ago Closed 2 years ago

Many warnings X-Mozilla-Keys header not found during mochitest and xpcshell test

Categories

(MailNews Core :: Database, defect)

Thunderbird 103
x86_64
Linux
defect

Tracking

(thunderbird_esr115 wontfix, thunderbird117 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
thunderbird_esr115 --- wontfix
thunderbird117 --- fixed

People

(Reporter: ishikawa, Assigned: benc)

Details

Attachments

(2 files)

Not sure if this is a serious problem, but I think 60 warnings in xpcshell test and 29 warnings in mochitest, and
especially the # of warnings from a single test, 39 warnings,
comm/mail/base/test/unit/test_viewWrapper_realFolder.js <--- many errors
suggests there is something wrong in the test setup or implicit assumptions behind the warning.

The warnings seem to have existed since the |NS_WARNING()| was inserted February this year (2022). So the problem, if any, has been dormant.

If the warnings are not serious, I would love to see the test to print
"You will see many X-Mozilla-Keys header not found warnings, but they are harmless" or something to that effect to make the future qa people effort easier.

The errors are seen in
xpcshell test

comm/mail/base/test/unit/test_viewWrapper_realFolder.js <--- many errors
comm/mail/components/extensions/test/xpcshell/test_ext_messages.js
comm/mail/components/extensions/test/xpcshell/test_ext_messages_query.js
comm/mailnews/db/gloda/test/unit/test_index_messages_local.js

mochitest

comm/mail/test/browser/folder-display/browser_deletionFromVirtualFolders.js
comm/mail/test/browser/folder-display/browser_mailViews.js
comm/mail/test/browser/folder-display/browser_messageCommands.js
comm/mail/test/browser/message-header/browser_messageHeader.js
comm/mail/test/browser/quick-filter-bar/browser_filterLogic.js
comm/mail/test/browser/quick-filter-bar/browser_stickyFilterLogic.js

I am attaching the output of

egrep "(TEST_START|TEST_END|X-Mozilla-Keys header not found)" /FF-NEW/log1472-xpcshell-4.txt

followd by the output of

egrep "(TEST_START|TEST_END|X-Mozilla-Keys header not found)" /FF-NEW/log1473-mochitest-4.txt

to show that other tests do not have the warnings.

I am requesting info from Ben Since Ben inserted the |NS_WARNING()| that prints the warning, so he may be able to figure out the seriousness or pass the analysis to someone in the know.

I have also noticed there are half a dozen bugzilla entries related to X-Mozilla-Keys. The printed warnings may be related to those issues.

Flags: needinfo?(benc)

I've only had a cursory look at this, but I think this is down to test messages being generated without X-Mozilla-Status, X-Mozilla-Status2 or X-Mozilla-Keys headers.
For example, a lot of the tests use MessageInjection.jsm to generate dummy messages. That ends up using MessageGenerator.makeMessage() to generate individual messages, with no obvious sign of X-Mozilla-* headers.

It's reasonable enough that the test messages don't have those headers - the X-Mozilla-* headers are only used for local folders. But even with local folders it's a little inconsistent. I'm pretty sure there are a few pathways where messages slip into local folders without the extra headers.

In any case, missing those headers isn't fatal. They are backups of message flags and keywords from the message database.

I think the correct thing would be to just ditch the NS_WARNING. Shall I do that?

Anyway... for completeness and some background, here are my notes on the X-Mozilla-* headers:


X-Mozilla-* headers

Local folders add a few custom headers to messages when they are stored to disk.
These headers stash message flags and keywords in the message, mirroring the values in the message database.

I think the original idea was that the mbox was the 'definitive' source of truth, and that the message database was just a summary - a throwaway index to make accessing messages easy, one which could always be rebuilt from the mbox.
This is still mostly the case for local folders - a "Repair Folder" will rebuild the database by scanning the mbox (or maildir!).

To avoid having to repack messages on disk when the metadata changes, the headers are written with some blank space which can later be rewritten in place.
The functions which perform this in-place update are nsMsgLocalStoreUtils::RewriteMsgFlags() and nsMsgLocalStoreUtils::ChangeKeywordsHelper().

If a header is missing or doesn't have enough space for a in-place edit, it is generally just left up to the next folder compaction to rewrite the header with the full value.

X-Mozilla-Status & X-Mozilla-Status2

These hold the message flags (Read, Replied, Marked etc. See
comm/mailnews/base/public/nsMsgMessageFlags.idl for the full list).

X-Mozilla-Status holds the lower 16bits worth of flags, as a 4 digit hex number: X-Mozilla-Status: xxxx.

X-Mozilla-Status2 holds the upper 16bits flags only, with the lower 16 bits zeroed. It's a 8-digit number with lower 4 digits always zero: X-Mozilla-Status2: xxxx0000.

Yes, this seems a bit bonkers. It should just be a single header. Historical reasons, I guess.

The flags are defined by nsMsgMessageFlags, in comm/mailnews/base/public/nsMsgMessageFlags.idl.

X-Mozilla-Keys

This holds a list of any keywords the message is tagged with, eg:
X-Mozilla-Keys: $label1 $label2
By default, the value is padded with spaces to reserved about 80 characters for further in-place edits.

Flags: needinfo?(benc)

Suppose if someone wants to add labels to the messages, and many of them, and the length goes over, say, 120 characters or whatever length previous header has been created.
What happens, then?

If a header is missing or doesn't have enough space for a in-place edit, it is generally just left up to the next folder compaction to rewrite the
header with the full value.

I am a bit confused here.
Is there a table of labels, and there is a SEPARATE db for showing which labels are attached to each message, and that db gets updated with correct
labels and in this case, the overflowed X-Mozilla-Keys is a stand-by? But this contradicts

that the message database was just a summary - a throwaway index to make accessing messages easy, one which could always be rebuilt from the mbox.

Hmm. We may want to see what happens when we add many labels before deciding to remove X-Mozilla-Keys.

Are you still seeing so many of these warnings?

Flags: needinfo?(ishikawa)
Version: Trunk → Thunderbird 103

During mochitest, here are the tests that showed the error(s).
I print the test start and test end line so that we can see in which the error occurs.

50:03.16 TEST_START: comm/mail/base/test/browser/browser_cardsView.js
50:06.43 GECKO(98622) [Parent 98622, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
50:06.53 GECKO(98622) [Parent 98622, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
50:07.57 TEST_END: Test OK. Subtests passed 20/20. Unexpected 0
54:26.77 TEST_START: comm/mail/base/test/browser/browser_messageMenu.js
54:43.88 GECKO(98622) [Parent 98622, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
54:56.70 TEST_END: Test OK. Subtests passed 516/518. Unexpected 2
171:25.60 TEST_START: comm/mail/test/browser/quick-filter-bar/browser_filterLogic.js
171:28.07 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:28.07 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:28.07 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:28.07 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:28.07 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:35.79 TEST_END: Test OK. Subtests passed 22/22. Unexpected 0
171:38.48 TEST_START: comm/mail/test/browser/quick-filter-bar/browser_stickyFilterLogic.js
171:39.36 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:39.36 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:39.36 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:39.36 GECKO(126877) [Parent 126877, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
171:41.44 TEST_END: Test OK. Subtests passed 15/15. Unexpected 0

During xpcshell test (with DEBUG version of TB) and the test executed with "xpcshell-test --sequential --verbose" to mach command.
I see the following errors.

00:05.15 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.15 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.15 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.15 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.15 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.16 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.16 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.16 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.16 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.16 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.16 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.16 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.16 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.17 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.18 pid:58964 [Parent 58964, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
00:05.60 TEST_END: Test PASS. Subtests passed 1/1. Unexpected 0
00:58.98 TEST_START: xpcshell-local.ini:comm/mail/components/extensions/test/xpcshell/test_ext_messages.js
01:02.14 pid:62298 [Parent 62298, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:02.22 pid:62298 [Parent 62298, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:03.75 TEST_END: Test PASS. Subtests passed 375/375. Unexpected 0
01:20.87 TEST_START: xpcshell-local.ini:comm/mail/components/extensions/test/xpcshell/test_ext_messages_query.js
01:21.10 pid:63511 [Parent 63511, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:21.10 pid:63511 [Parent 63511, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:21.10 pid:63511 [Parent 63511, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:21.10 pid:63511 [Parent 63511, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:21.10 pid:63511 [Parent 63511, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:21.10 pid:63511 [Parent 63511, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:24.43 TEST_END: Test PASS. Subtests passed 50/50. Unexpected 0
01:24.43 TEST_START: xpcshell-local.ini:comm/mail/components/extensions/test/xpcshell/test_ext_messages_update.js
01:24.80 pid:63721 [Parent 63721, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:26.51 pid:63721 [Parent 63721, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:26.61 pid:63721 [Parent 63721, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:26.62 pid:63721 [Parent 63721, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:26.62 pid:63721 [Parent 63721, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:26.67 pid:63721 [Parent 63721, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:26.67 pid:63721 [Parent 63721, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:27.30 TEST_END: Test PASS. Subtests passed 384/384. Unexpected 0
01:20.91 TEST_START: comm/mailnews/db/gloda/test/unit/test_index_messages_local.js
01:22.13 pid:74718 [Parent 74718, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:30.59 pid:74718 [Parent 74718, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:30.90 pid:74718 [Parent 74718, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:31.42 pid:74718 [Parent 74718, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:31.73 pid:74718 [Parent 74718, Main Thread] WARNING: X-Mozilla-Keys header not found.: file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/local/src/nsMsgLocalStoreUtils.cpp:333
01:40.53 TEST_END: Test PASS. Subtests passed 167/167. Unexpected 0


Regarding too many tags for a message, I found an issue with tag creation.
See Bug 1846336
tag creation fails from Tags pull down menu due to conflict of existing tag name, but the tag actually is created.

I think if we create 40 tags and try to assign them to a single message, we will overflow X-Mozilla-Keys and I wonder what happens then.

Flags: needinfo?(ishikawa)

Oops, wrong copy&Paste. I fixed the errror in xpshell test part in the previous message.

I just checked the behavior of X-Mozilla-Keys.
I added about 20 tags.
It turns out the tags are recorded on the X-Mozilla-Keys as the tag strings. The built-in tags are recorded as $label1, $label2, $label3, ...
User-defined tags are recorded with their name entirely.
So during the tag addition phase, the X-Mozilla-Keys overflows and the labels are no longer recorded there.
There is no space to write the tags in mbox.

But the assignment of tags are REMEMBERED in different database. (Mork ?)
So that information is fully valid and the display of tags of the message persists across the quitting and running TB again.

Now, if I compact the folder, then the compaction code understands there are enough labels that will not fit into the ordinary X-Mozilla-Keys and decide to create a long enough line to write all the labels. Clever.

(In reply to ISHIKAWA, Chiaki from comment #7)

I just checked the behavior of X-Mozilla-Keys.

I think there's a good argument for getting rid of the X-Mozilla-* headers altogether. They replicate metadata that is in the msgDB. Back in the olden days, you'd more think of the msgDB as being a cache of metadata extracted from the mbox file. In that mindset, the mbox is the definitive record of messages, and I think it made sense to slip flags and keywords into the mbox using X-Mozilla-* headers. You'd consider the msgDB merely as a throw-away cache to avoid extra reparsing. But these days with online-only folders, junk scores and assorted other msgDB-only metadata, the msgDB is really the definitive record of messages. And as such, adding X-Mozilla-* headers is really just a complication I could do without.

[edit]
I thought it'd be good to write up my notes on the X-Mozilla-* headers.
Then I found I'd already done that, so I posted them in this comment.
Then I realised that they were exactly the same notes I posted up in Comment 2.
So I'm now editing this comment to remove the notes.
It's been a long day.

Anyway, I'm not too worried about the test warnings... some tests tend to slip messages into folders without going through the usual channels, and odd things like X-Mozilla-* headers aren't added, but that's no big deal.
But I'm going to remove the warnings anyway. They don't add anything useful, and they're messy.

Assignee: nobody → benc
Status: NEW → ASSIGNED

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/0ab0d274a753
Remove NS_WARNING noise when modifying X-Mozilla-Keys headers. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch

Comment on attachment 9346599 [details]
Bug 1781134 - Remove NS_WARNING noise when modifying X-Mozilla-Keys headers. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9346599 - Flags: approval-comm-beta+

wontfix for esr115 per matrix

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

Attachment

General

Created:
Updated:
Size: