Thunderbird Webextensions .messages.getFull() 引发异常 0x80004005 (NS_ERROR_FAILURE)
Thunderbird Webextensions .messages.getFull() raises Exception 0x80004005 (NS_ERROR_FAILURE)
这是以下question/answer的一种跟进:
该问题末尾的代码获取帐户列表,选择 emailAccountName
,从 wantedMailFolderType
获取 MessageList 对象并尝试仅从一个 messageId 获取 MessagePart 对象通过 browser.messages.getFull( messageId ) 始终失败并显示以下异常消息:
[Exception...
"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIMsgMessageService.streamMessage]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame :: resource:///modules/gloda/mimemsg.js
:: MsgHdrToMimeMessage
:: line 238" data: no]
mimemsg.js:238:16
此行为在 linux mint 19.3(64 位)运行ning thunderbird 68.4.1(64 位)上相同
以及 windows 7(64 位)运行ning 雷鸟 68.2.2(32 位)。
这里是重现错误的代码:
emailAccountName = "firstname.lastname@email.com";
wantedMailFolderType = "trash";
console.log( tstamp() + " Entered Main Program" );
function tstamp () {
let d =new Date();
return "" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds();
}
function accountsList_successCallback( arrayOfMailAccount ) {
console.log( tstamp() + " Entered accountsList_successCallback()" );
let accountId = false;
for (let i = 0; i < arrayOfMailAccount.length; i++) {
if ( arrayOfMailAccount[i].name == emailAccountName ) {
accountId = arrayOfMailAccount[i].id;
break;
}
}
console.log( tstamp() + " Leaving accountsList_successCallback(), returning accountId: " + accountId );
return accountId;
}
function mailAccount_successCallback( mailAccount ) {
console.log( tstamp() + " Entered mailAccount_successCallback()" );
let mailFolder = false;
for (let i = 0; i < mailAccount.folders.length; i++) {
if ( mailAccount.folders[i].type == wantedMailFolderType ) {
mailFolder = mailAccount.folders[i];
break;
}
}
console.log( tstamp() + " Leaving mailAccount_successCallback(), returning mailFolder: " + mailFolder.type );
return mailFolder;
}
async function getMessagesList( mailFolder ) {
console.log( tstamp() + " Entered getMessagesList()" );
let page = await browser.messages.list( mailFolder );
let messageHeader = page.messages[ 0 ];
let messageId = messageHeader.id;
console.log( `Trying to .getFull( messageId == ${messageId} ) MessagePart object now...` );
let messagePart = await browser.messages.getFull( messageId );
console.log( tstamp() + " Leaving getMessagesList()" );
}
browser.accounts.list()
.then( accountsList_successCallback) // after .accounts.list() Promise is fulfilled...
// accountsList_successCallback is called, which
// in this example returns the accountId string...
.then( accountId => browser.accounts.get( accountId ))
.then( mailAccount_successCallback) // after .accounts.get() Promise is fulfilled...
// mailAccount_successCallback is called, which
// returns the wanted MailFolder...
.then( getMessagesList ) // ... passed to getMessagesList(), which successfully
// awaits a MessageList object...
// but every call to .getFull( messageId ) fails.
.catch( finalCatch )
;
function finalCatch( error ) {
console.error( "ERROR passed to finalCatch() : " + error);
}
console.log( tstamp() + " Leaving Main Program" );
这是最后一个 运行 的输出(popup.js 中的行号被删掉了,因为它们与这个摘录不匹配):
52:40.859 Entered Main Program popup.js:xx:9
52:40.874 Leaving Main Program popup.js:xx:9
52:40.964 Entered accountsList_successCallback() popup.js:xx:13
52:40.964 Leaving accountsList_successCallback(), returning accountId: account26 popup.js:xx:13
52:40.988 Entered mailAccount_successCallback() popup.js:xx:13
52:40.989 Leaving mailAccount_successCallback(), returning mailFolder: trash popup.js:xx:13
52:40.989 Entered getMessagesList() popup.js:xx:13
Trying to .getFull( messageId == 1 ) MessagePart object now... popup.js:xx:13
[Exception...
"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIMsgMessageService.streamMessage]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame :: resource:///modules/gloda/mimemsg.js
:: MsgHdrToMimeMessage
:: line 238" data: no]
mimemsg.js:238:16
ERROR passed to finalCatch() : Error: An unexpected error occurred popup.js:xx:13
有人可以在他的机器上试试这个吗?
如何进行下一步?
应该报告 BugZilla 上的错误吗?
提前致谢。理查德
问题已解决!
只要且仅当另一台 PC 上的同一个 IMAP 帐户的另一个登录处于活动状态时,就会引发异常。
似乎只要同一个电子邮件帐户同时有多个登录或会话,就会引发异常。
抱歉打扰了。
非常感谢您的关注。理查德
这是以下question/answer的一种跟进:
该问题末尾的代码获取帐户列表,选择 emailAccountName
,从 wantedMailFolderType
获取 MessageList 对象并尝试仅从一个 messageId 获取 MessagePart 对象通过 browser.messages.getFull( messageId ) 始终失败并显示以下异常消息:
[Exception...
"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIMsgMessageService.streamMessage]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame :: resource:///modules/gloda/mimemsg.js
:: MsgHdrToMimeMessage
:: line 238" data: no]
mimemsg.js:238:16
此行为在 linux mint 19.3(64 位)运行ning thunderbird 68.4.1(64 位)上相同 以及 windows 7(64 位)运行ning 雷鸟 68.2.2(32 位)。
这里是重现错误的代码:
emailAccountName = "firstname.lastname@email.com";
wantedMailFolderType = "trash";
console.log( tstamp() + " Entered Main Program" );
function tstamp () {
let d =new Date();
return "" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds();
}
function accountsList_successCallback( arrayOfMailAccount ) {
console.log( tstamp() + " Entered accountsList_successCallback()" );
let accountId = false;
for (let i = 0; i < arrayOfMailAccount.length; i++) {
if ( arrayOfMailAccount[i].name == emailAccountName ) {
accountId = arrayOfMailAccount[i].id;
break;
}
}
console.log( tstamp() + " Leaving accountsList_successCallback(), returning accountId: " + accountId );
return accountId;
}
function mailAccount_successCallback( mailAccount ) {
console.log( tstamp() + " Entered mailAccount_successCallback()" );
let mailFolder = false;
for (let i = 0; i < mailAccount.folders.length; i++) {
if ( mailAccount.folders[i].type == wantedMailFolderType ) {
mailFolder = mailAccount.folders[i];
break;
}
}
console.log( tstamp() + " Leaving mailAccount_successCallback(), returning mailFolder: " + mailFolder.type );
return mailFolder;
}
async function getMessagesList( mailFolder ) {
console.log( tstamp() + " Entered getMessagesList()" );
let page = await browser.messages.list( mailFolder );
let messageHeader = page.messages[ 0 ];
let messageId = messageHeader.id;
console.log( `Trying to .getFull( messageId == ${messageId} ) MessagePart object now...` );
let messagePart = await browser.messages.getFull( messageId );
console.log( tstamp() + " Leaving getMessagesList()" );
}
browser.accounts.list()
.then( accountsList_successCallback) // after .accounts.list() Promise is fulfilled...
// accountsList_successCallback is called, which
// in this example returns the accountId string...
.then( accountId => browser.accounts.get( accountId ))
.then( mailAccount_successCallback) // after .accounts.get() Promise is fulfilled...
// mailAccount_successCallback is called, which
// returns the wanted MailFolder...
.then( getMessagesList ) // ... passed to getMessagesList(), which successfully
// awaits a MessageList object...
// but every call to .getFull( messageId ) fails.
.catch( finalCatch )
;
function finalCatch( error ) {
console.error( "ERROR passed to finalCatch() : " + error);
}
console.log( tstamp() + " Leaving Main Program" );
这是最后一个 运行 的输出(popup.js 中的行号被删掉了,因为它们与这个摘录不匹配):
52:40.859 Entered Main Program popup.js:xx:9
52:40.874 Leaving Main Program popup.js:xx:9
52:40.964 Entered accountsList_successCallback() popup.js:xx:13
52:40.964 Leaving accountsList_successCallback(), returning accountId: account26 popup.js:xx:13
52:40.988 Entered mailAccount_successCallback() popup.js:xx:13
52:40.989 Leaving mailAccount_successCallback(), returning mailFolder: trash popup.js:xx:13
52:40.989 Entered getMessagesList() popup.js:xx:13
Trying to .getFull( messageId == 1 ) MessagePart object now... popup.js:xx:13
[Exception...
"Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIMsgMessageService.streamMessage]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame :: resource:///modules/gloda/mimemsg.js
:: MsgHdrToMimeMessage
:: line 238" data: no]
mimemsg.js:238:16
ERROR passed to finalCatch() : Error: An unexpected error occurred popup.js:xx:13
有人可以在他的机器上试试这个吗? 如何进行下一步? 应该报告 BugZilla 上的错误吗?
提前致谢。理查德
问题已解决!
只要且仅当另一台 PC 上的同一个 IMAP 帐户的另一个登录处于活动状态时,就会引发异常。 似乎只要同一个电子邮件帐户同时有多个登录或会话,就会引发异常。
抱歉打扰了。
非常感谢您的关注。理查德