fix: strike through cancelled events and mute their reminders #572
This commit is contained in:
@@ -302,6 +302,19 @@ describe('getPendingAlerts', () => {
|
||||
expect(result).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('skips alerts for cancelled events', () => {
|
||||
// iTIP CANCEL marks the attendee's copy with status "cancelled" instead
|
||||
// of deleting it (#572) - its reminders must not fire.
|
||||
const event = makeEvent({
|
||||
status: 'cancelled',
|
||||
alerts: { 'a1': makeAlert() },
|
||||
});
|
||||
const calendars = [makeCalendar()];
|
||||
const now = fiveMinBefore + 1000;
|
||||
const result = getPendingAlerts([event], calendars, new Set(), now);
|
||||
expect(result).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('skips email action alerts', () => {
|
||||
const event = makeEvent({
|
||||
alerts: { 'a1': makeAlert({ action: 'email' }) },
|
||||
|
||||
@@ -103,6 +103,8 @@ export function getPendingAlerts(
|
||||
const pending: PendingAlert[] = [];
|
||||
|
||||
for (const event of events) {
|
||||
if (event.status === 'cancelled') continue;
|
||||
|
||||
const alerts = getEffectiveAlerts(event, calendars);
|
||||
if (!alerts) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user