mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 16:13:15 +00:00
Recurring events defaulted skip:"omit"+rscale:"gregorian" on every rule,
which Stalwart serialises into the CalDAV RRULE as RSCALE=GREGORIAN;SKIP=OMIT.
DAVx5 rejects that ("Invalid recurrence rule"), breaking Android sync. Those
RFC 7529 fields only matter for non-Gregorian scales / invalid-date handling,
so stop emitting them for plain Gregorian rules.
- lib/recurrence-rule.ts: createRecurrenceRule() helper with no skip/rscale.
- CalendarRecurrenceRule.rscale/skip are now optional.
- event-modal + recurrence-editor build rules via the helper.
- demo fixture cleaned; unit test asserts no skip/rscale.
Closes #805.
34 lines
908 B
TypeScript
34 lines
908 B
TypeScript
import type { CalendarRecurrenceRule } from '@/lib/jmap/types';
|
|
|
|
type Frequency = CalendarRecurrenceRule['frequency'];
|
|
|
|
/**
|
|
* A plain Gregorian recurrence rule with all by-parts unset. `rscale`/`skip`
|
|
* are intentionally omitted: they only matter for non-Gregorian scales /
|
|
* invalid-date handling, and defaulting them made Stalwart serialise
|
|
* `RSCALE=GREGORIAN;SKIP=OMIT` into the RRULE, which DAVx5 rejects (#805).
|
|
*/
|
|
export function createRecurrenceRule(
|
|
frequency: Frequency,
|
|
overrides: Partial<CalendarRecurrenceRule> = {},
|
|
): CalendarRecurrenceRule {
|
|
return {
|
|
'@type': 'RecurrenceRule',
|
|
frequency,
|
|
interval: 1,
|
|
firstDayOfWeek: 'mo',
|
|
byDay: null,
|
|
byMonthDay: null,
|
|
byMonth: null,
|
|
byYearDay: null,
|
|
byWeekNo: null,
|
|
byHour: null,
|
|
byMinute: null,
|
|
bySecond: null,
|
|
bySetPosition: null,
|
|
count: null,
|
|
until: null,
|
|
...overrides,
|
|
};
|
|
}
|