browser.accounts.list() fails if a Gmail/IMAP folder contains a '%' character
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr78? fixed, thunderbird89 fixed, thunderbird90?)
People
(Reporter: dreadnaut, Assigned: TbSync)
References
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
|
Details | Review |
5.12 KB,
patch
|
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
Steps to reproduce:
In the options page of the "BorderColors-D"¹ add-on, I use browser.accounts.list()
to retrieve all identities. A user found an issue² where the call would fail. Eventually, we tracked this down to the existence of a folder named "%Something".
I can reproduce this on TB89.0b1, if the folder is part of a Gmail account connected via IMAP. (Note: I don't have a non-Gmail IMAP account to test). No trouble when the folder is under Local Folder.
In the error console I can find this message:
malformed URI sequence 2 ext-mail.js:1509
map self-hosted:224
folderURIToPath chrome://messenger/content/parent/ext-mail.js:1509
convertFolder chrome://messenger/content/parent/ext-mail.js:1575
traverseSubfolders chrome://messenger/content/parent/ext-mail.js:1597
traverseSubfolders chrome://messenger/content/parent/ext-mail.js:1600
traverseSubfolders chrome://messenger/content/parent/ext-mail.js:1600
convertAccount chrome://messenger/content/parent/ext-mail.js:1459
list chrome://messenger/content/parent/ext-accounts.js:18
list self-hosted:1178
result resource://gre/modules/ExtensionParent.jsm:935
withPendingBrowser resource://gre/modules/ExtensionParent.jsm:491
result resource://gre/modules/ExtensionParent.jsm:935
callAndLog resource://gre/modules/ExtensionParent.jsm:897
recvAPICall resource://gre/modules/ExtensionParent.jsm:934
InterpretGeneratorResume self-hosted:1485
AsyncFunctionNext self-hosted:695
Which points to the decodeURIComponent
call in this function:
/**
* Convert a folder URI to a human-friendly path.
* @return {String}
*/
function folderURIToPath(uri) {
let path = Services.io.newURI(uri).filePath;
return path
.split("/")
.map(decodeURIComponent)
.join("/");
}
[1] https://addons.thunderbird.net/en-GB/thunderbird/addon/bordercolors-d/
[2] https://github.com/dreadnaut/bordercolors-d/issues/18#issuecomment-824395128
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/21d62e67ea80
Do not encode/decodeURIComponent the folderURI of IMAP folders (which fails if % are used). r=darktrojan
Updated•4 years ago
|
Comment 6•4 years ago
|
||
Short time? I've filed this bug about 4 month ago. See Bug 1684327. But thanks anyway.
Assignee | ||
Comment 7•4 years ago
|
||
The test for this is simple, and it also seems to fix bug 1688612, so we should backport this to 78, as it fixes two important API methods (messages.query and messages.list)
Assignee | ||
Comment 9•4 years ago
|
||
Assignee | ||
Comment 10•4 years ago
|
||
Comment on attachment 9219031 [details]
Bug 1707408 - Do not encode/decodeURIComponent the folderURI of IMAP folders (which fails if % are used). r=darktrojan
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
This fixed multiple annoying bugs.
Testing completed (on c-c, etc.):
https://treeherder.mozilla.org/jobs?repo=try-comm-central&test_paths=comm%2Fmail%2Fcomponents%2Fextensions%2Ftest%2Fbrowser&revision=21d540f356137e043836bbc0505dfc5f84426029
Risk to taking this patch (and alternatives if risky):
Low.
Comment 11•4 years ago
|
||
Comment on attachment 9219031 [details]
Bug 1707408 - Do not encode/decodeURIComponent the folderURI of IMAP folders (which fails if % are used). r=darktrojan
[Triage Comment]
Approved for beta
Assignee | ||
Updated•4 years ago
|
Comment 12•4 years ago
|
||
bugherder uplift |
Thunderbird 89.0b4:
https://hg.mozilla.org/releases/comm-beta/rev/3b6418dff6a3
Assignee | ||
Comment 13•4 years ago
•
|
||
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
This fixed multiple annoying bugs.
Testing completed (on c-c, etc.):
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=433531c52d4f4e40b5599004fb9e41fac0233341
Risk to taking this patch (and alternatives if risky):
Low
Comment 14•4 years ago
|
||
Comment on attachment 9221517 [details] [diff] [review]
ESR78_D113697_2.diff
[Triage Comment]
Approved for esr78
Comment 15•4 years ago
|
||
bugherder uplift |
Thunderbird 78.10.2:
https://hg.mozilla.org/releases/comm-esr78/rev/9f4cf7494b38
Description
•