Calendars should be passed to calIObserver.onStartBatch and onEndBatch
Categories
(Calendar :: Provider: CalDAV, enhancement)
Tracking
(thunderbird_esr78 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | wontfix |
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(2 files)
onStartBatch and onEndBatch exist to give observers the chance to ignore notifications they're not interested in. For example if you know you're going to be reloading soon, you can ignore onAddItem and onModifyItem notifications until then. To give more fine-grained control, we should pass the calendar in question to the batch notifications.
Assignee | ||
Comment 1•4 years ago
|
||
Depends on D109272
Assignee | ||
Comment 2•4 years ago
|
||
This makes the alarm service ignore onAddItem and onModifyItem notifications in between onStartBatch and onEndBatch.
We know that onLoad will follow, at which point we reload all alarms from the calendar in question.
Ignoring the notifications prevents the alarms from firing multiple times in quick succession as the calendar loads.
I have in mind to follow this pattern across all of the UI pieces that listen to notifications, but first I really want to be sure (with tests) that sane behaviour is occurring.
I've added tests for this and (really lightly) the unifinder with all of the calendar types. More testing will be added to this later.
The ICS calendar with offline storage doesn't quite work right (as is the case in bug 1691885) but we can still test what does work.
Depends on D109273
Updated•4 years ago
|
Updated•4 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/e944239ffe2d
Pass a calendar to calIObserver.onStartBatch and onEndBatch. r=mkmelin
https://hg.mozilla.org/comm-central/rev/9a728acf9240
Use batch notifications for better handling in CalAlarmService. r=mkmelin
Assignee | ||
Updated•4 years ago
|
Description
•