Closed Bug 1863095 Opened 1 year ago Closed 1 year ago

Move folders API to an id-based API in MV3

Categories

(Thunderbird :: Add-Ons: Extensions API, task)

Tracking

(thunderbird_esr115 wontfix)

RESOLVED FIXED
121 Branch
Tracking Status
thunderbird_esr115 --- wontfix

People

(Reporter: TbSync, Assigned: TbSync)

References

Details

Attachments

(1 file)

After we introduced a MailFolderId, this patch allows using the MailFolderId in addition to the MailFolder object in all folder related functions in MV2.

Following a discussion in the last add-on developer call, where the following was raised, I will change the MailFolderId to be an integer in one of the next patches. The reason for this is:

  • the current API allows using an arbitrary path, and even though the docs say to NOT create a path manually, add-on developers do that, which causes bugs and headaches.
  • the current MailFolderId has the same flaw
  • an integer id will make the API more robust
  • I also hope that I can make the integer id follow folder moves.

As a consequence, this patch enforces the usage of the MailFolderId in MV3, by deprecating the MailFolder object as input parameter.

There is a loose end which will be tackled in the next patch: Some functions (like the copy/create/move folder function) allow specifying an account to access the root folder. This will be solved by introducing a real root folder, which will have a MailFolderId and can be used like any other folder, and we no longer need to use accounts as "destination" for certain folder operations in MV3.

I updated all except 3 tests to use MailFolderIds, so we can test both supported variations in MV2.

In all tests which have been adjusted, I also minimized creating MailFolder objects or MailFolderIds manually

Assignee: nobody → john
Attachment #9361964 - Attachment description: WIP: Bug 1863095 - Move folders API to an id-based API in MV3 → Bug 1863095 - Move folders API to an id-based API in MV3. r=mkmelin
Status: NEW → ASSIGNED
Blocks: 1863269

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/bd719e913191
Move folders API to an id-based API in MV3. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Depends on: 1863321
Target Milestone: --- → 121 Branch

search bugmail for "addons1234" to delete these messages

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

Attachment

General

Created:
Updated:
Size: