Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(events): [PPT-1473] prefer metadata with ext_data over metadata without #335

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/controllers/events.cr
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ class Events < Application
EventMetadata.by_tenant(tenant.id).by_events_or_master_ids(ical_uids, event_master_ids).each { |meta|
# where there might be multiple resource calendars on the event we want to pick
# metadatas that most closely match the request
next if (existing = metadatas[meta.ical_uid]?) && calendars[existing.resource_calendar]?
# and has the most information
next if (existing = metadatas[meta.ical_uid]?) && calendars[existing.resource_calendar]? &&
!(calendars[meta.resource_calendar]? && meta.ext_data)

metadatas[meta.ical_uid] = meta
if recurring_master_id = meta.recurring_master_id
Expand Down