Closed Bug 775472 Opened 14 years ago Closed 7 months ago

Saved search/virtual folder fails to automatically update when incoming POP3 messages are moved by filters

Categories

(Thunderbird :: Filters, defect)

12 Branch
Desktop
All
defect

Tracking

(Not tracked)

RESOLVED FIXED
151 Branch

People

(Reporter: bugzilla, Assigned: welpy-cw, NeedInfo)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [regression:tb12])

Attachments

(1 external file)

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1 Build ID: 20120614114901 Steps to reproduce: My Thunderbird has lots of subfolders and filters. To keep track of all new mails I have a virtual folder which shows me all mails (from all subfolders) with status 'new'. Actual results: Up to version 11 the following worked fine: When I retrieved new mails the virtual folder would update its content automatically. -> New mails were shown instantly. Since version 12 (and still with version 14): The virtual folder only shows new mails which come to my main inbox (the parent folder). If I want to show ALL new mails (from all subfolders) I need to navigate to any other folder and then back to the virtual folder. This is annoying. Expected results: The virtual folder should update its content on the fly when retrieving new mails.
David Bienvenu, maybe some fallout from the pluggable mailstores? Some notification is no longer sent?
(In reply to :aceman from comment #1) > David Bienvenu, maybe some fallout from the pluggable mailstores? Some > notification is no longer sent? Possibly - my guess would be that it specifically has to do with the new flag handling in the case of message filters that move messages. Are these imap or pop3 server messages?
(In reply to stefahn from comment #0) > My Thunderbird has lots of subfolders and filters. > To keep track of all new mails I have a virtual folder which shows me all > mails (from all subfolders) with status 'new'. I would like to add that the behaviour still is correct (i.e. as it was in version 11 and earlier) as long as the new mail remains in the inbox folder. As soon as the new mail is moved by a filter into another folder, the virtual folder does not recognize it as "new" anymore.
Uwe, can you reply to comment 2: Pop or Imap?
Summary: Ver 12+: Virtual folder (collecting new mails from other folders) doesn't update automatically when retrieving mails → Saved Search virtual folder (collecting mails marked "Unread") doesn't update automatically when incoming new mail is filtered into folders other than inbox
(In reply to Thomas D. from comment #4) > Uwe, can you reply to comment 2: Pop or Imap? It happened in POP. In my IMAP account I had no virtual folders. But I just created one and tested it. Result: In IMAP TB behaves differently, i.e. the incoming mail is transferred to a subfolder by a filter, and the virtual folder which is linked to the subfolder displays the new mail correctly in red (= new).
Any update on this? Would love to see a fix for this since it's still not fixed in 17.0.1. Thanks!
Hi stefahn. fixable by bug 510392, even though you cite this as a regression (which I assume still happens, so I've marked the bug NEW). Or Or bug 539526? If not, can you get the regression range using nightly builds?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(bugzilla)
OS: Windows XP → All
Whiteboard: [regression:tb12]
Hi Wayne, This still happens. Not sure what a regression is (something that worked before but no longer does?).
Update: After some minutes the virtual folder seems to get updated and new mails are shown. My assumption is that only new mails of those folders are shown, which I work on. So if I delete a mail from folder x, new mails from folder x are then shown in my virtual folder.
Severity: normal → S3
Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED
Component: Folder and Message Lists → Filters
Regressed by: 402392
Hardware: x86 → Desktop
Summary: Saved Search virtual folder (collecting mails marked "Unread") doesn't update automatically when incoming new mail is filtered into folders other than inbox → Saved search/virtual folder fails to automatically update when incoming POP3 messages are moved by filters
Version: 14 Branch → 12 Branch

This patch fixes a race condition in nsParseNewMailState::MoveIncorporatedMessage
where Virtual Folders (Saved Searches) failed to display newly filtered messages,
particularly those utilizing 'New' status or body-content search criteria.

  1. Corrects Notification Timing for Search Sessions:
    Changes CopyHdrFromExistingHdr to not notify listeners prematurely (notify=false).
    Previously, OnHdrAdded was broadcast before AppendMsgFromStream had written the
    message to the store, causing body-content searches to fail. By deferring the
    notification to AttachHdr, we ensure the message body is fully streamed to disk
    and flags are set before Virtual Folders attempt to match the header.

  2. Ensures UI Visibility:
    Calls SetHasNewMessages(true) on the destination folder immediately after
    attachment. This ensures the folder pane correctly reflects the arrival of
    new mail without requiring user interaction or a manual folder click.

  3. Improves Key Safety and Database Integration:
    Switches from m_new_key to nsMsgKey_None in CopyHdrFromExistingHdr. This
    prevents potential key collisions by allowing the destination database to
    assign a fresh, valid message key from its own sequence.

  4. Formalizes Header Attachment:
    Explicitly utilizes AttachHdr with notification enabled (notify=true) to
    integrate the detached header into the target database, ensuring all subsequent
    processing flags and UI updates are applied to the live header instance.

Inspired by https://github.com/Betterbird/thunderbird-patches/blob/main/140/bugs/1767190-1801464-announce-header-after-move.patch

Attachment #9553264 - Attachment description: Bug 775472 - Ensure Virtual Folders and UI update correctly for filtered POP3 moves. r=#thunderbird-reviewers → Bug 775472 - Ensure Virtual Folders and UI update correctly for filtered POP3 moves. r=#thunderbird-back-end-reviewers
Attachment #9553264 - Attachment description: Bug 775472 - Ensure Virtual Folders and UI update correctly for filtered POP3 moves. r=#thunderbird-back-end-reviewers → Bug 775472 - Ensure Virtual Folders and UI update correctly for filtered POP3 moves. r=BenC,#thunderbird-back-end-reviewers
See Also: → 1890253
Depends on: 1890253
See Also: 1890253 →
Target Milestone: --- → 151 Branch

Pushed by sking@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/9d18f0290fcf
Ensure Virtual Folders and UI update correctly for filtered POP3 moves. r=BenC

Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
See Also: → 2038015
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: