Closed Bug 1881615 Opened 1 year ago Closed 7 months ago

messenger.messages.update vs messenger.messages.onUpdated

Categories

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

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: buecher, Unassigned)

Details

documentation: it may be worth mentioning that messenger.messages.update does not always trigger messenger.messages.onUpdated.

The first can be called with the current values, not changing anything. Then, the event is not triggered.

This is related to our discussion of preparing a stack so that in onUpdate we know that we ourselves did the update. But if I fill the stack by messages.update, it cannot be cleared if onUpdated is not triggered, opening a new can of worms because now messageIds stay in the stack.

If the message was not changed, then I cannot fire an messages.onUpdated event. The approach here is to not update the message in your scenario, if the message will not be changed by the call. You can check the current state before calling messages.update()

Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.