Closed Bug 1883602 Opened 2 years ago Closed 2 years ago

nsIMsgFolder::sizeOnDiskWithSubFolders does not work with smart folders in the unified folders view

Categories

(MailNews Core :: Backend, defect)

Thunderbird 123
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1834510

People

(Reporter: babolivier, Assigned: babolivier)

References

(Regression)

Details

(Keywords: regression)

Such folders have no sub-folders, so sizeOnDiskWithSubFolders is 0.

From an initial investigation, it looks like the relationship between a smart folder and its "children" only exists in the frontend. When SmartServerUtils.getSmartServer() is called, it iterates over a list of flags, and for each flag it doesn't have a folder for, it lists the folders with the same flag on each account and adds them to the searchFolderUri property of the folder's info (which is then read when wrapping the folder into a virtual folder wrapper and calling wrappedFolder.searchFolders()).

TL;DR: smart folders don't have subfolders as far as the backend is concerned (regardless of the frontend rendering them otherwise), they have search folders, and this relation is represented in a completely different way in the backend (which is not much besides a char property for the frontend to use).

After chatting with Martin and Vineet, we concluded the best fix for this is to special-case smart folders and calculate their size on the frontend, and use the sizeOnDiskWithSubFolders property for any other folder. I'll close this bug and let Vineet update the patch for bug 1834510.

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

This bug doesn't have a patch, plus the patch hasn't yet landed in bug 1834510, so changing this to duplicate of bug 1834510

Duplicate of bug: 1834510
Resolution: FIXED → DUPLICATE
Version: unspecified → Thunderbird 123
You need to log in before you can comment on or make changes to this bug.