API compose.sendMessage returns Promise with incomplete MessageHeader when email in Sent Folder is selected while sending
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr102? fixed, thunderbird103 fixed)
People
(Reporter: florian.unger, Assigned: TbSync)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
rjl
:
approval-comm-esr102+
|
Details | Review |
Steps to reproduce:
In an addon I compose a new mail (either a new mail or a reply to an existing mail) and then send the composed mail through the new API compose.sendMessage
Actual results:
When any mail in Sent folder is selected or
when the Sent folder in the folder pane of the main mail view alone is selected (without selecting a mail from the Sent folder)
while I compose and send a mail
then the returned Promise of the compose.sendMessage API call always has an incompletely filled messageheader object.
The returned Promise object looks like this:
{ "mode": "sendNow", "messages": [ { "id": 4, "date": "1970-01-01T00:00:00.000Z", "author": "", "recipients": [], "ccList": [], "bccList": [], "subject": "", "read": false, "headersOnly": false, "flagged": false, "junk": false, "junkScore": 0, "headerMessageId": "", "size": 0, "folder": { "accountId": "account3", "name": "Sent", "path": "/Sent", "type": "sent" }, "tags": [] } ], "headerMessageId": "92755f33-9606-aa32-60c7-5188ec56e3b5@dummy.com" }
Expected results:
the messages array should be correctly filled with the copies of the sent message.
I forgot to mention, the "headerMessageId" and "id" of the "messages" object are filled correctly.
But all other values like "date", "recipients", ... are wrong or empty.
Updated•3 years ago
|
This probably is related to a behavior I saw in Thunderbird 78 while I was developing the Experiment-API which was the inspiration for implementing API compose.sendMessage.
I recognized two strange behaviours/bugs while testing it (I used Thunderbird 78.8.1)
When 'Message Synchronizing' is deactivated for the Sent folder and I try to open the message with the messageId I got from the "onAfterSend" event using messenger.messages.getFull I get this exception:
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMessageService.streamMessage]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource:///modules/gloda/MimeMessage.jsm :: MsgHdrToMimeMessage :: line 236" data: no] MimeMessage.jsm:236:16 MsgHdrToMimeMessage resource:///modules/gloda/MimeMessage.jsm:236 getFull chrome://messenger/content/parent/ext-messages.js:212 getFull chrome://messenger/content/parent/ext-messages.js:210 getFull self-hosted:844 result resource://gre/modules/ExtensionParent.jsm:996 withPendingBrowser resource://gre/modules/ExtensionParent.jsm:602 result resource://gre/modules/ExtensionParent.jsm:996 callAndLog resource://gre/modules/ExtensionParent.jsm:958 recvAPICall resource://gre/modules/ExtensionParent.jsm:995 AsyncFunctionNext self-hosted:693
The second and much stranger behaviour: When the Sent folder is selected in the folder pane of the main mail view while I compose and send a mail and then I try to get the messageheader for the messageId I got from the "onAfterSend" event using messenger.messages.get(messageId) then the returned messageheader is always null.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/404155c0c03f
Convert msgHdr directly before it becomes invalid. r=#thunderbird-reviewers,mkmelin
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
@ florian.unger : Can you verify, this is fixed in the latest Daily (2022-07-13)?
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
•
|
||
Comment on attachment 9284942 [details]
Bug 1778508 - Convert msgHdr directly before it becomes invalid. r=#thunderbird-reviewers
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Add-ons sometimes return invalid messageHeaders
Testing completed (on c-c, etc.):
1 day on Daily, manual testing
Risk to taking this patch (and alternatives if risky):
Low. All I did was moving the conversion step to where we see the msgHdr, instead of storing the msgHdr object and converting it later.
Comment 7•3 years ago
|
||
Comment on attachment 9284942 [details]
Bug 1778508 - Convert msgHdr directly before it becomes invalid. r=#thunderbird-reviewers
[Triage Comment]
Approved for beta
I tested the Daily 104 from 2022-07-13 and it is fixed there. I was not able to reproduce the error anymore.
Many thanks for fixing this!
Will this get backported into the next ESR release?
Comment 9•3 years ago
|
||
bugherder uplift |
Thunderbird 103.0b6:
https://hg.mozilla.org/releases/comm-beta/rev/72eba3dbed7a
Assignee | ||
Comment 10•3 years ago
|
||
Comment on attachment 9284942 [details]
Bug 1778508 - Convert msgHdr directly before it becomes invalid. r=#thunderbird-reviewers
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Add-ons sometimes return invalid messageHeaders
Testing completed (on c-c, etc.):
1 day on Beta
Risk to taking this patch (and alternatives if risky):
Low. All I did was moving the conversion step to where we see the msgHdr, instead of storing the msgHdr object and converting it later.
Assignee | ||
Comment 11•3 years ago
|
||
Patch applies cleanly to comm-esr102.
Comment 12•3 years ago
|
||
Comment on attachment 9284942 [details]
Bug 1778508 - Convert msgHdr directly before it becomes invalid. r=#thunderbird-reviewers
[Triage Comment]
approved for esr102
Comment 13•3 years ago
|
||
bugherder uplift |
Thunderbird 102.1.0:
https://hg.mozilla.org/releases/comm-esr102/rev/d181f4e50351
Description
•