olin-build / ABE

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

GET requests to nonexistent recurrence subevents return event data #58

Open audreywl opened 7 years ago

audreywl commented 7 years ago

In response to https://abe-dev.herokuapp.com/events/?start=2017-6-24&end=2017-8-5

{
    "description": "Fika (Swedish pronunciation: [\u00b2fi\u02d0ka]) is a concept in Swedish (and Finnish) culture with the basic meaning \"to have coffee\", often accompanied with pastries, cookies or pie.", 
    "end": "Thu, 06 Jul 2017 20:45:00 GMT", 
    "labels": [
      "summer", 
      "library"
    ], 
    "location": "Library UL", 
    "sid": "5967cf21e44d4623ad11c961", 
    "start": "Thu, 06 Jul 2017 19:00:00 GMT", 
    "title": "Coffee Break"
}

In response to https://abe-dev.herokuapp.com/events/5967cf21e44d4623ad11c961/2017-07-06T15:00:00

{
  "description": "Fika (Swedish pronunciation: [\u00b2fi\u02d0ka]) is a concept in Swedish (and Finnish) culture with the basic meaning \"to have coffee\", often accompanied with pastries, cookies or pie.", 
  "end": "Thu, 06 Jul 2017 16:45:00 GMT", 
  "labels": [
    "summer", 
    "library"
  ], 
  "location": "Library UL", 
  "rec_id": "Thu, 06 Jul 2017 15:00:00 GMT", 
  "sid": "5967cf21e44d4623ad11c961", 
  "start": "Thu, 06 Jul 2017 15:00:00 GMT", 
  "title": "Coffee Break"
}
audreywl commented 7 years ago

nvm this was totally me. I was passing the local time instead of UTC time, so the backend was generating the offset. the second request should have been made to https://abe-dev.herokuapp.com/events/5967cf21e44d4623ad11c961/2017-07-06T19:00:00 instead.

newsch commented 7 years ago

This seems to be the symptom of a different problem - there's no checking on the backend if the rec_id is actually a date defined by the recurrence. Instead it simply returns a dummy event at the time specified.

All of these links will return events:

Edit: updated links