olin-build / ABE

Amorphous Blob of Events
https://abe.olin.build/
GNU Affero General Public License v3.0
7 stars 1 forks source link

The API should reject events with both `recurrence.count` and `recurrence_end` #196

Open osteele opened 6 years ago

osteele commented 6 years ago

These are not valid iCalendar events. Currently the server ignores recurrence.count when recurrence_end is present. Better would be not to allow such data to enter the store.

This will require an update to sample_events.json.

This doesn't strictly require, but should probably be done in conjunction with, cleaning the dev and production databases. A query of production db.getCollection('event').find({recurrence_end: {$exists: true}, "recurrence.count": {$exists: true}}, {title:1, start:1, recurrence_end:1, recurrence:1}) shows six events in production that contain both fields, as of 2018-04-29. Visual inspection shows that the count and end date of each of these events are consistent, so it doesn't matter which is removed. db.getCollection('event').update({recurrence_end: {$exists: true}, "recurrence.count": {$exists: true}}, {$unset: {"recurrence.count: false}}) (untested) ought to remove the recurrence end from these events.