mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
The "+ add to schedule" flow passes the PluginSearchResult shape, where `start`/`duration` are epoch-ms numbers, but extractSyncValues only handled the iCal-string shape returned by getById. parseIcalDateTime then ran `.slice()` on a number, throwing `n.slice is not a function`, so the task was silently never created for every CalDAV event. Branch extractSyncValues on the value type: numeric start -> start_date (all-day) or start_dateTime (timed) with numeric duration_ms; string start keeps the existing iCal-parsing path. Guard parseIcalDateTime against non-string input, and guard the numeric branch with Number.isFinite so a NaN/Infinity start can't throw in toISOString or seed a corrupt write-back baseline. Factor the YYYYMMDD->YYYY-MM-DD conversion into ymdToIsoDate, shared by both branches. Add regression specs for the numeric timed, numeric all-day, and non-finite-start shapes. |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| icon.svg | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||
| vitest.config.ts | ||