Closed Bug 1862574 Opened 2 years ago Closed 2 years ago

Fix inconsistency regarding MailFolderInfo.favorite being a property, not an info

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

(2 files)

I originally wanted to address this in Bug 1861948 already, but decided against it to keep the patch small. This however increased the inconsistency even further.

The MailFolderInfo type together with its getter function and event deal with status information. But favorite is a property. I cannot tell why it was not added to the MailFolder type directly, probably because we did not have a getter for the MailFolder (the same reason why getFolderUsage() was introduced, to get MailFolder.usage).

I therefore plan to do the following:

  • deprecate MailFolderInfo.favorite and return it together with usage directly as MailFolder.favorite, and MailFolderInfo.favorite being removed in MV3
  • introduce a MailFolder.folderId
  • introduce folders.get(folderId), which returns the current representation of the MailFolder
  • Remove folders.getFolderUsage() (which was just added as an intermediate solution)
  • introduce folders.onUpdated as a replacement for folders.onFolderUsageChanged, which reports on changed favorite and changed usage
  • allow to use folders.update() to set usage of a folder. (that must be exposed thru the accounts API)
Assignee: nobody → john
Attachment #9361573 - Attachment description: WIP: Bug 1862574 - Resolve inconsistency regarding MailFolderInfo.favorite by moving it into the MailFolder type and adjusting all relevant functions and events - introducing a folderId and folders.get(). → Bug 1862574 -Resolve inconsistency regarding MailFolderInfo.favorite by moving it into the MailFolder type and adjusting all relevant functions and events - introducing a folderId and folders.get(). r=mkmelin
Status: NEW → ASSIGNED
Attachment #9361573 - Attachment description: Bug 1862574 -Resolve inconsistency regarding MailFolderInfo.favorite by moving it into the MailFolder type and adjusting all relevant functions and events - introducing a folderId and folders.get(). r=mkmelin → Bug 1862574 - Resolve inconsistency regarding MailFolderInfo.favorite by moving it into the MailFolder type and adjusting all relevant functions and events - introducing a folderId and folders.get(). r=mkmelin
Blocks: 1862745
Target Milestone: --- → 121 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/b301368c47ae
Resolve inconsistency regarding MailFolderInfo.favorite by moving it into the MailFolder type and adjusting all relevant functions and events - introducing a folderId and folders.get(). r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/bb0431fcb0db Fix MailFolderId parsing. r=mkmelin

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: