Closed Bug 1631184 Opened 4 months ago Closed 4 months ago

Marking messages as read or flagged with browser.messages.update fails to persist for IMAP folders

Categories

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

defect
Not set
critical

Tracking

(thunderbird_esr68 fixed, thunderbird76 fixed)

RESOLVED FIXED
Thunderbird 77.0
Tracking Status
thunderbird_esr68 --- fixed
thunderbird76 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(1 file)

With the browser.messages.update API, doing something like:

await browser.messages.update(m.message._id, { read: true });

works fine for locally stored messages.

However, when doing it on a message in an IMAP folder, it looks like it has been marked as read, but then when you switch folder and back again, it reverts to unread.

I think the problem is the operations are being done directly on the message header, not the folder.

I think I have a patch for this.

Assignee: nobody → standard8
Summary: Marking messages as read with browser.messages.update fails to persist for IMAP folders → Marking messages as read or flagged with browser.messages.update fails to persist for IMAP folders

This fixes it by moving away from directly setting on the header, and instead using functions on the folder - the folder functions do the necessary changes on the function as well as changing the headers.

Attachment #9141486 - Flags: review?(mkmelin+mozilla)
Attachment #9141486 - Flags: review?(geoff)
Comment on attachment 9141486 [details] [diff] [review]
Use folder methods rather than the header directly

Thanks Mark, that's better.
Attachment #9141486 - Flags: review?(mkmelin+mozilla)
Attachment #9141486 - Flags: review?(geoff)
Attachment #9141486 - Flags: review+
Duplicate of this bug: 1606965

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/8b801d401469
Marking messages as read or flagged with browser.messages.update fails to persist for IMAP folders. r=darktrojan

Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 77.0
Attachment #9141486 - Flags: approval-comm-esr68?
Attachment #9141486 - Flags: approval-comm-beta?
Comment on attachment 9141486 [details] [diff] [review]
Use folder methods rather than the header directly

approved
Attachment #9141486 - Flags: approval-comm-beta? → approval-comm-beta+
Comment on attachment 9141486 [details] [diff] [review]
Use folder methods rather than the header directly

Not long lived on beta, but no problems reported and narrow scope to addons, so approved for ESR
Attachment #9141486 - Flags: approval-comm-esr68? → approval-comm-esr68+
You need to log in before you can comment on or make changes to this bug.