Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions app/backend/proto/internal/jobs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ message GenerateEventCreateNotificationsPayload {
message GenerateEventUpdateNotificationsPayload {
int64 updating_user_id = 1;
int64 occurrence_id = 2;
// TODO(#9117): Remove once unused. Was not i18n-friendly. Use updated_enum_items.
repeated string updated_str_items = 3 [deprecated = true];
reserved 3; // Formerly "updated_str_items", was not i18n-friendly. Use updated_enum_items.
// EventUpdateItem is from the shared protos and cannot be referenced here.
// int32 has the same on-wire encoding.
repeated int32 updated_enum_items = 4;
Expand Down
21 changes: 0 additions & 21 deletions app/backend/src/couchers/email/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,6 @@ def from_notification(cls, data: notification_data_pb2.EventUpdate, *, user_name
updated_items: list[notification_data_pb2.EventUpdateItem.ValueType] = []
if data.updated_enum_items:
updated_items.extend(data.updated_enum_items)
elif data.updated_str_items:
for updated_str_item in data.updated_str_items:
if updated_enum_item := cls._updated_item_str_to_enum(updated_str_item):
updated_items.append(updated_enum_item)

return cls(
user_name=user_name,
Expand All @@ -808,23 +804,6 @@ def from_notification(cls, data: notification_data_pb2.EventUpdate, *, user_name
updated_items=updated_items,
)

# TODO(#9117): Backcompat. Remove update_str_items fallback once known unused.
@staticmethod
def _updated_item_str_to_enum(value: str) -> notification_data_pb2.EventUpdateItem.ValueType | None:
match value:
case "title":
return notification_data_pb2.EventUpdateItem.EVENT_UPDATE_ITEM_TITLE
case "content":
return notification_data_pb2.EventUpdateItem.EVENT_UPDATE_ITEM_CONTENT
case "location":
return notification_data_pb2.EventUpdateItem.EVENT_UPDATE_ITEM_LOCATION
case "start time":
return notification_data_pb2.EventUpdateItem.EVENT_UPDATE_ITEM_START_TIME
case "end time":
return notification_data_pb2.EventUpdateItem.EVENT_UPDATE_ITEM_END_TIME
case _:
return None

@staticmethod
def _updated_item_to_string_key(value: notification_data_pb2.EventUpdateItem.ValueType) -> str | None:
match value:
Expand Down
2 changes: 0 additions & 2 deletions app/backend/src/couchers/servicers/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,6 @@ def generate_event_update_notifications(payload: jobs_pb2.GenerateEventUpdateNot
data=notification_data_pb2.EventUpdate(
event=event_to_pb(session, occurrence, context),
updating_user=user_model_to_pb(updating_user, session, context),
# TODO(#9117): Remove update_str_items once known unused.
updated_str_items=payload.updated_str_items,
updated_enum_items=(
notification_data_pb2.EventUpdateItem.ValueType(value) for value in payload.updated_enum_items
),
Expand Down
3 changes: 1 addition & 2 deletions app/proto/notification_data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ enum EventUpdateItem {
message EventUpdate {
org.couchers.api.events.Event event = 1;
org.couchers.api.core.User updating_user = 2;
// TODO(#9117): Remove once unused. Was not i18n-friendly. Use updated_enum_items.
repeated string updated_str_items = 3 [deprecated = true];
reserved 3; // Formerly "updated_str_items", was not i18n-friendly. Use updated_enum_items.
Comment thread
tristanlabelle marked this conversation as resolved.
repeated EventUpdateItem updated_enum_items = 4;
}

Expand Down
Loading