Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message: Make `draft_id` not optional in `LocalMessage`.
Evy Kassirerf186a0edbbaa
diff --git a/web/src/echo.ts b/web/src/echo.tsindex 158dda57521..1185e97a275 100644--- a/web/src/echo.ts+++ b/web/src/echo.ts@@ -99,7 +99,7 @@ export type RawLocalMessage = MessageRequestObject & {id: number;topic_links: TopicLink[];reactions: MessageReaction[];- draft_id: string | undefined;+ draft_id: string;} & (StreamMessageObject | PrivateMessageObject);export type PostMessageAPIData = z.output<typeof send_message_api_response_schema>;diff --git a/web/src/message_helper.ts b/web/src/message_helper.tsindex b213f9a6f36..ffd638eabc7 100644--- a/web/src/message_helper.ts+++ b/web/src/message_helper.ts@@ -155,8 +155,6 @@ export function process_new_message(opts: NewMessage): ProcessedMessage {// When we have a new format for `display_recipient` in message objects in// the API itself, we'll naturally clean this up.assert(rest.display_recipient !== undefined);- // TODO: Make `draft_id` not optional in `LocalMessage` (upcoming commit)- assert(rest.draft_id !== undefined);const local_message: LocalMessage = {...rest,sent_by_me,@@ -172,7 +170,6 @@ export function process_new_message(opts: NewMessage): ProcessedMessage {display_reply_to: undefined,display_recipient: rest.display_recipient,client: electron_bridge === undefined ? "website" : "ZulipElectron",- draft_id: rest.draft_id,submessages: [],};message_user_ids.add_user_id(local_message.sender_id);@@ -209,8 +206,6 @@ export function process_new_message(opts: NewMessage): ProcessedMessage {// When we have a new format for `display_recipient` in message objects in// the API itself, we'll naturally clean this up.assert(rest.display_recipient !== undefined);- // TODO: Make `draft_id` not optional in `LocalMessage` (upcoming commit)- assert(rest.draft_id !== undefined);const local_message: LocalMessage = {...rest,sent_by_me,@@ -225,7 +220,6 @@ export function process_new_message(opts: NewMessage): ProcessedMessage {to_user_ids,clean_reactions,display_recipient: rest.display_recipient,- draft_id: rest.draft_id,submessages: [],client: electron_bridge === undefined ? "website" : "ZulipElectron",};