Summary
parseRRule doesn't validate the FREQ value against the supported set. In the RRULE-string branch it only checks that FREQ is present, then casts it straight to the union — so an unsupported value like FREQ=HOURLY passes parsing and blows up later elsewhere with a message disconnected from the actual input. The object-input branch validates nothing at all.
Details
x-scheduler-internals-premium/src/internals/utils/recurring-events/rRuleString.ts:
String branch — checks presence but not the value:
if (!rruleObject.FREQ) { throw /* must include FREQ */ }
const rrule = { freq: rruleObject.FREQ as SchedulerProcessedEventRecurrenceRule['freq'] }; // unvalidated cast
It validates INTERVAL, BYDAY, etc., but not that FREQ is one of DAILY | WEEKLY | MONTHLY | YEARLY.
Object branch — no validation:
if (typeof input === 'object') {
// only resolves `until`, returns the object as-is
}
Note on scope
The object branch is the typed API (SchedulerEventRecurrenceRule.freq is the union), so TS users are protected at compile time there — the real gap is the RRULE-string branch (a free-form string bypasses the types, so FREQ=HOURLY sneaks in). Validating both at runtime is the defensive choice (JS users / dynamic data can bypass either).
Suggested fix
Validate freq against the supported set (DAILY/WEEKLY/MONTHLY/YEARLY) at parse time in both branches, throwing a clear MUI X Scheduler: error (what happened / why / how to fix) that names the offending value — instead of a late, disconnected failure. Run pnpm extract-error-codes after adding the error.
Context
@mui/x-scheduler-internals-premium (master, pre-stable). Input validation / avoids a confusing late error; requires invalid input → Medium.
Summary
parseRRuledoesn't validate theFREQvalue against the supported set. In the RRULE-string branch it only checks thatFREQis present, then casts it straight to the union — so an unsupported value likeFREQ=HOURLYpasses parsing and blows up later elsewhere with a message disconnected from the actual input. The object-input branch validates nothing at all.Details
x-scheduler-internals-premium/src/internals/utils/recurring-events/rRuleString.ts:String branch — checks presence but not the value:
It validates
INTERVAL,BYDAY, etc., but not thatFREQis one ofDAILY | WEEKLY | MONTHLY | YEARLY.Object branch — no validation:
Note on scope
The object branch is the typed API (
SchedulerEventRecurrenceRule.freqis the union), so TS users are protected at compile time there — the real gap is the RRULE-string branch (a free-form string bypasses the types, soFREQ=HOURLYsneaks in). Validating both at runtime is the defensive choice (JS users / dynamic data can bypass either).Suggested fix
Validate
freqagainst the supported set (DAILY/WEEKLY/MONTHLY/YEARLY) at parse time in both branches, throwing a clearMUI X Scheduler:error (what happened / why / how to fix) that names the offending value — instead of a late, disconnected failure. Runpnpm extract-error-codesafter adding the error.Context
@mui/x-scheduler-internals-premium(master, pre-stable). Input validation / avoids a confusing late error; requires invalid input → Medium.