folders.query can return folders from unsupported accounts (e.g. rss)
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr128 affected)
Tracking | Status | |
---|---|---|
thunderbird_esr128 | --- | affected |
People
(Reporter: Fallen, Assigned: TbSync)
Details
Attachments
(1 obsolete file)
messenger.accounts.list() returns a list of accounts and filters heavily on which types are supported. RSS for example is not supported at the moment.
messenger.folders.query({ recent: true, limit: 15 , canAddMessages: true })
will however happily return RSS folders. They have an accountId
which is not returned by messenger.accounts.list
.
Side note, canAddMessages
has no effect in combination with recent: true
, as the filtering occurs before. Let me know if you prefer a separate bug for this.
Assignee | ||
Comment 1•3 months ago
|
||
We changed the account API code for 128 to only return "known" types, and skip others, allowing us to use an enum for the type def, which improves documentation and expectations.
Since I was not aware that we did support rss and owl accounts in the past, these two were dropped. They are being returned here:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1909005
- https://bugzilla.mozilla.org/show_bug.cgi?id=1912393.
Can I close this as Dupe of 1912393?
Assignee | ||
Comment 2•3 months ago
|
||
1912393 could need a review :-)
Reporter | ||
Comment 3•3 months ago
|
||
That would solve rss, but the bug would still occur for other folder types that we don't support in the API, but could feasibly be "recent" folders. What you likely need to do is apply the types filter (and various other folders.query filters like canAddMessages) after https://searchfox.org/comm-central/rev/41a8982a48c4f4a921989b6ed7f17acf82d4523f/mail/components/extensions/parent/ext-folders.js#886
Assignee | ||
Comment 4•1 month ago
|
||
Updated•1 month ago
|
Updated•1 month ago
|
Assignee | ||
Comment 5•1 month ago
|
||
@Fallen: Are the proposed changes what you had in mind?
Assignee | ||
Updated•1 month ago
|
Updated•4 days ago
|
Assignee | ||
Comment 6•4 days ago
|
||
The issue is indeed fixed by the two bugs listed in Comment #1. The parentFolders
Array, which is the base definition of which folders are to be searched and returned, can no longer include accounts or folders which are not supported by the API.
While working on this, I did see that the getMostRecentFolders()
function does not return a sorted folder list in some occasions, which is covered in Bug 1928926.
There is one possible optimization: Instead of calling getMostRecentFolders()
on the final list of found folders, we could limit each parentFolder
to its recent subfolders. This would skip folders in the query check, which can never be part of the result. This is evaluated in Bug 1928953.
Assignee | ||
Updated•4 days ago
|
Description
•