Skip to content

Allow ICS export by ID for series or single occurrence #961

@carrythebanner

Description

@carrythebanner

When using the ICS endpoint (i.e. "Export to calendar" in the front end) to fetch an event by ID, it is currently expecting a calevent ID aka listing/series ID. For single occurrence rides, this is fine; there's only 1 occurrence, so the series and the occurrence are one and the same. If a listing has multiple events — say, it's been cancelled & rescheduled, or it's a repeating ride — the ICS export contains all of the occurrences. The context on the front end implies that it's scoped just to the current occurrence, so this is somewhat unexpected. Depending on the calendar client, importing an ICS file containing multiple events may not import all of the contained events (just the first?) or leastwise it might not be obvious what happened.

ICS endpoint docs: https://github.com/shift-org/shift-docs/blob/main/docs/CALENDAR_API.md#exporting-an-event

I think it would make more sense to export using the caldaily ID, aka occurrence ID, at least by default. On our front end, this would export just the single occurrence that you're viewing. Changing this would be a breaking change to the API, however, so a backwards compatible way to move forward might be to add new params that explicitly specify the ID type. This could look something like:
/ics.php?series_id={calevent_id}
/ics.php?event_id={caldaily_id}

We could then change our front end to fetch event_id specifically. To keep things backwards compatible, the existing id param could alias to series_id for now, but in a future major API version we could change that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions