Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix: channel and email double send (#101)

Peter Chinmanc5e5b1188f1d
diff --git a/js/app/packages/app/index.css b/js/app/packages/app/index.css
index a94fb8d678..22b770e0c8 100644
--- a/js/app/packages/app/index.css
+++ b/js/app/packages/app/index.css
@@ -703,14 +703,10 @@ html[data-modality="keyboard"] [contenteditable="true"]:focus-visible::after {
}
@container (width < 816px) {
- margin-inline: calc(var(--spacing) * 4)
- /* 1rem = 16px */
- ;
+ margin-inline: calc(var(--spacing) * 4);
}
@container (width < 640px) {
- margin-inline: calc(var(--spacing) * 2)
- /* 1rem = 16px */
- ;
+ margin-inline: calc(var(--spacing) * 2);
}
}
diff --git a/js/app/packages/block-channel/component/BaseInput.tsx b/js/app/packages/block-channel/component/BaseInput.tsx
index ec19026f84..742445ded4 100644
--- a/js/app/packages/block-channel/component/BaseInput.tsx
+++ b/js/app/packages/block-channel/component/BaseInput.tsx
@@ -7,6 +7,7 @@ import { handleFileUpload } from '@block-channel/utils/inputAttachments';
import { isInBlock } from '@core/block';
import { FileDropOverlay } from '@core/component/FileDropOverlay';
import { IconButton } from '@core/component/IconButton';
+import { setEditorStateFromMarkdown } from '@core/component/LexicalMarkdown/utils';
import { fileDrop } from '@core/directive/fileDrop';
import { TOKENS } from '@core/hotkey/tokens';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
@@ -61,7 +62,7 @@ type InputAttachmentsStore = {
type BaseInputProps = {
/** callback to be executed when the user clicks the send button
* or presses enter */
- onSend: typeof sendMessage;
+ onSend: (args: Parameters<typeof sendMessage>[0]) => Promise<void>;
/** callback to be executed when the user changes the input */
onChange: (content: string) => void;
/** callback to be executed when the user clears the input */
@@ -102,7 +103,7 @@ export function BaseInput(props: BaseInputProps) {
const key = props.inputAttachments.key;
const [showFormatRibbon, setShowFormatRibbon] = createSignal(false);
const [isDraggedOver, setIsDraggedOver] = createSignal(false);
-
+ const [isPendingSend, setIsPendingSend] = createSignal(false);
const [isValidChannelDrag] = isInBlock()
? isValidChannelDragSignal
: createSignal(false);
@@ -163,6 +164,7 @@ export function BaseInput(props: BaseInputProps) {
setNodeFormat,
mentions,
MarkdownArea,
+ editor,
ref,
} = useChannelMarkdownArea();
@@ -289,8 +291,12 @@ export function BaseInput(props: BaseInputProps) {
}
function handleSend() {
+ if (isPendingSend()) return false;
+ setIsPendingSend(true);
const content = markdownState();
- console.log('content', content);
+ clearMarkdownArea();
+ focusMarkdownArea();
+
const args = {
content: content,
attachments: props.inputAttachments.store[key] ?? [],
@@ -301,13 +307,23 @@ export function BaseInput(props: BaseInputProps) {
.onSend(args)
.then(() => {
props.inputAttachments.setStore(key, []);
- clearMarkdownArea();
- focusMarkdownArea();
stopTyping();
return props.afterSend?.();
})
- .catch((err) => {
- logger.error('onSend failed', { error: err });
+ .catch((_) => {
+ // Restore the stashed editor state
+ clearMarkdownArea();
+ try {
+ setEditorStateFromMarkdown(editor, content);
+ } catch (e) {
+ logger.error('Failed to restore editor state after send error', {
+ error: e,
+ });
+ }
+ focusMarkdownArea();
+ })
+ .finally(() => {
+ setIsPendingSend(false);
});
return true;
@@ -407,9 +423,9 @@ export function BaseInput(props: BaseInputProps) {
placeholder={props.placeholder}
onEnter={
isMobileWidth()
- ? undefined
- : () => {
- if (hasPendingAttachments()) {
+ ? (_e) => false
+ : (_e) => {
+ if (hasPendingAttachments() || isPendingSend()) {
return true;
}
return handleSend();
@@ -493,7 +509,7 @@ export function BaseInput(props: BaseInputProps) {
>
<div class="bg-transparent rounded-full size-8 flex flex-row justify-center items-center">
<Show
- when={!hasPendingAttachments()}
+ when={!hasPendingAttachments() && !isPendingSend()}
fallback={
<Spinner class="w-5 h-5 animate-spin cursor-disabled" />
}
diff --git a/js/app/packages/block-channel/component/ChannelInput.tsx b/js/app/packages/block-channel/component/ChannelInput.tsx
index 52e311cc07..e57d32bd7d 100644
--- a/js/app/packages/block-channel/component/ChannelInput.tsx
+++ b/js/app/packages/block-channel/component/ChannelInput.tsx
@@ -31,8 +31,8 @@ export function ChannelInput(props: ChannelInputProps) {
const channelId = useBlockId();
const sendMessage_ = createCallback(
- async (args: Parameters<typeof sendMessage>[0]) => {
- await sendMessage(args);
+ (args: Parameters<typeof sendMessage>[0]) => {
+ return sendMessage(args);
}
);
const postTypingUpdate_ = createCallback(postTypingUpdate);
diff --git a/js/app/packages/block-channel/signal/channel.ts b/js/app/packages/block-channel/signal/channel.ts
index 2bc390285b..1e3d492c2f 100644
--- a/js/app/packages/block-channel/signal/channel.ts
+++ b/js/app/packages/block-channel/signal/channel.ts
@@ -273,7 +273,7 @@ export async function sendMessage({
if (isErr(result)) {
console.error('failed to send message', result[0]);
toast.failure('Failed to send message');
- return;
+ return Promise.reject(result[0] ?? new Error('Failed to send message'));
}
const { id } = result[1]!;
diff --git a/js/app/packages/block-email/component/BaseInput.tsx b/js/app/packages/block-email/component/BaseInput.tsx
index d7eae7a9b3..a3298a744e 100644
--- a/js/app/packages/block-email/component/BaseInput.tsx
+++ b/js/app/packages/block-email/component/BaseInput.tsx
@@ -36,7 +36,6 @@ import type {
import { useEmail, useUserId } from '@service-gql/client';
import type { FileType } from '@service-storage/generated/schemas/fileType';
import type { Item } from '@service-storage/generated/schemas/item';
-import { raceTimeout } from '@solid-primitives/promise';
import {
defaultSelectionData,
lazyRegister,
@@ -48,7 +47,6 @@ import {
} from 'core/component/LexicalMarkdown/plugins/node-transform/nodeTransformPlugin';
import { registerHotkey, useHotkeyDOMScope } from 'core/hotkey/hotkeys';
import {
- $createParagraphNode,
$getRoot,
FORMAT_TEXT_COMMAND,
type LexicalEditor,
@@ -62,6 +60,7 @@ import {
For,
onCleanup,
onMount,
+ type Setter,
Show,
untrack,
} from 'solid-js';
@@ -73,6 +72,7 @@ import { getFirstName } from '../util/name';
import {
APPEND_PREVIOUS_EMAIL_COMMAND,
appendItemsAsMacroMentions,
+ clearEmailBody,
prepareEmailBody,
registerAppendPreviousEmail,
} from '../util/prepareEmailBody';
@@ -131,6 +131,7 @@ export function BaseInput(props: {
draftContainsAppendedReply?: boolean;
preloadedAttachments?: AttachmentMacro[];
sideEffectOnSend?: (newMessageId: MessageToSendDbId | null) => void;
+ setShowReply?: Setter<boolean>;
markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;
}) {
const ctx = useEmailContext();
@@ -235,7 +236,7 @@ export function BaseInput(props: {
}
async function executeSaveDraft() {
- if (bodyMacro().trim().length === 0) {
+ if (bodyMacro().trim().length === 0 || isPendingSend()) {
return;
}
const draftToSave = collectDraft();
@@ -400,56 +401,38 @@ export function BaseInput(props: {
});
if (!prepared) return;
- try {
- const response = await raceTimeout(
- emailClient.sendMessage({
- message: {
- bcc,
- body_html: prepared.bodyHtml,
- body_macro: bodyMacro(),
- body_text: prepared.bodyText,
- cc,
- provider_id: props.draft?.provider_id,
- provider_thread_id: currentThread?.provider_id,
- replying_to_id: props.replyingTo()?.db_id,
- subject: form().subject(),
- thread_db_id: currentThread?.db_id,
- to,
- link_id: linkId!,
- },
- }),
- 2000,
- true,
- new Error('Email send timed out')
- );
- if (isOk(response)) {
- toast.success('Email sent');
- const [, { message }] = response;
- prepared.mentions.forEach((mention) => {
- trackMention(blockId, 'document', mention.documentId);
- });
- editor()?.update(
- () => {
- const root = $getRoot();
- const paragraph = $createParagraphNode();
- root.clear();
- root.append(paragraph);
- },
- { tag: 'external' }
- );
- resetState();
- if (props.sideEffectOnSend) {
- props.sideEffectOnSend(message.db_id ?? null);
- }
- } else {
- toast.failure('Failed to send email. Please try again.');
- logger.error(new Error('Failed to send email'));
+ const response = await emailClient.sendMessage({
+ message: {
+ bcc,
+ body_html: prepared.bodyHtml,
+ body_macro: bodyMacro(),
+ body_text: prepared.bodyText,
+ cc,
+ provider_id: props.draft?.provider_id,
+ provider_thread_id: currentThread?.provider_id,
+ replying_to_id: props.replyingTo()?.db_id,
+ subject: form().subject(),
+ thread_db_id: currentThread?.db_id,
+ to,
+ link_id: linkId!,
+ },
+ });
+ if (isOk(response)) {
+ toast.success('Email sent');
+ const [, { message }] = response;
+ prepared.mentions.forEach((mention) => {
+ trackMention(blockId, 'document', mention.documentId);
+ });
+ clearEmailBody(editor());
+ resetState();
+ if (props.sideEffectOnSend) {
+ props.sideEffectOnSend(message.db_id ?? null);
}
- } catch (_) {
- toast.failure('Failed to send email. Please try again.');
- } finally {
- setIsPendingSend(false);
+ } else {
+ toast.failure('Failed to send email');
}
+
+ setIsPendingSend(false);
};
const resetState = () => {
@@ -463,12 +446,10 @@ export function BaseInput(props: {
const handleDeleteDraft = () => {
const draftId = savedDraftId();
if (!draftId) {
- toast.failure('No draft to delete');
- return;
+ return console.error('No draft to delete');
}
deleteEmailDraft(draftId).then((success) => {
if (success) {
- toast.success('Draft deleted');
if (props.replyingTo()?.db_id) {
ctx.setMessageDbIdToDraftChildren(
produce((state) => {
@@ -477,16 +458,9 @@ export function BaseInput(props: {
})
);
}
- editor()?.update(
- () => {
- const root = $getRoot();
- const paragraph = $createParagraphNode();
- root.clear();
- root.append(paragraph);
- },
- { tag: 'external' }
- );
+ clearEmailBody(editor());
resetState();
+ props.setShowReply?.(false);
} else {
toast.failure('Failed to delete draft');
}
@@ -578,7 +552,7 @@ export function BaseInput(props: {
ref={(el) => {
composeContainerRef = el;
}}
- class={`macro-message-width relative flex-1 flex flex-col border border-edge px-3 py-2 bg-input`}
+ class={`relative flex-1 flex flex-col border border-edge px-3 py-2 bg-input`}
>
{/* Top Bar */}
<div class="flex items-start gap-2">
@@ -789,7 +763,7 @@ export function BaseInput(props: {
<MarkdownTextarea
captureEditor={setEditor}
class={`text-sm break-words text-ink ${isDragging() && 'blur'}`}
- editable={() => true}
+ editable={() => !isPendingSend()}
initialValue={props.preloadedBody}
initialHtml={props.preloadedHtml}
placeholder=""
diff --git a/js/app/packages/block-email/component/Email.tsx b/js/app/packages/block-email/component/Email.tsx
index 708810443f..112c531833 100644
--- a/js/app/packages/block-email/component/Email.tsx
+++ b/js/app/packages/block-email/component/Email.tsx
@@ -452,6 +452,28 @@ export function Email(props: EmailProps) {
return true;
});
+ // If there is a focused message id, but it does not currently exist in the message list, it is because the user has just sent a message. When it does come into existence, we want to scroll to the bottom.
+ createEffect((prev: boolean | undefined) => {
+ const currentFocusedId = focusedMessageId();
+ const messages = filteredMessages();
+ if (!currentFocusedId || !messages) return true;
+
+ const currentIndex = messages.findIndex(
+ (m) => m.db_id === currentFocusedId
+ );
+ if (currentIndex < 0) return false;
+
+ if (prev === false) {
+ setTimeout(() => {
+ const container = messagesRef();
+ if (container) {
+ scrollToLastMessage(container, 'smooth');
+ }
+ }, 100);
+ }
+ return true;
+ });
+
const navigateMessage = createCallback((dir: 'prev' | 'next') => {
const currentFocusedId = focusedMessageId();
const messages = filteredMessages();
@@ -574,14 +596,18 @@ export function Email(props: EmailProps) {
{/* <div class="z-4 absolute left-[44px] bottom-[92px] w-[21px] rounded-bl-xl min-h-[84px] border-l border-b border-edge" /> */}
<Show when={filteredMessages()?.at(-1)}>
{(lastMessage) => (
- <div class="w-full flex flex-row justify-center my-2 bg-panel ">
- <EmailInput
- replyingTo={lastMessage}
- draft={messageDbIdToDraftChildren[lastMessage().db_id ?? '']}
- markdownDomRef={(el) => {
- markdownDomRef = el;
- }}
- />
+ <div class="shrink-0 w-full px-4 pb-2">
+ <div class="w-full flex flex-row justify-center bg-panel macro-message-width mx-auto">
+ <EmailInput
+ replyingTo={lastMessage}
+ draft={
+ messageDbIdToDraftChildren[lastMessage().db_id ?? '']
+ }
+ markdownDomRef={(el) => {
+ markdownDomRef = el;
+ }}
+ />
+ </div>
</div>
)}
</Show>
diff --git a/js/app/packages/block-email/component/EmailInput.tsx b/js/app/packages/block-email/component/EmailInput.tsx
index e83ea310ab..f992c2aaa9 100644
--- a/js/app/packages/block-email/component/EmailInput.tsx
+++ b/js/app/packages/block-email/component/EmailInput.tsx
@@ -2,16 +2,16 @@ import type {
MessageToSendDbId,
MessageWithBodyReplyless,
} from '@service-email/generated/schemas';
-import { type Accessor, createMemo, Show } from 'solid-js';
+import { type Accessor, createMemo, type Setter, Show } from 'solid-js';
import { produce } from 'solid-js/store';
import { decodeBase64Utf8 } from '../util/decodeBase64';
-import { scrollToLastMessage } from '../util/scrollToMessage';
import { BaseInput } from './BaseInput';
import { useEmailContext } from './EmailContext';
interface EmailInputProps {
replyingTo: Accessor<MessageWithBodyReplyless>;
draft?: MessageWithBodyReplyless;
+ setShowReply?: Setter<boolean>;
markdownDomRef?: (ref: HTMLDivElement) => void | HTMLDivElement;
}
@@ -53,14 +53,6 @@ export function EmailInput(props: EmailInputProps) {
// Set focus to new message if provided
if (newMessageId) ctx.setFocusedMessageId(newMessageId);
-
- // Scroll last message into view after DOM updates
- setTimeout(() => {
- const container = ctx.messagesRef();
- if (container) {
- scrollToLastMessage(container, 'smooth');
- }
- }, 100);
}
return (
@@ -71,6 +63,7 @@ export function EmailInput(props: EmailInputProps) {
preloadedHtml={draftHTML()}
draftContainsAppendedReply={draftContainsAppendedReply()}
sideEffectOnSend={afterSend}
+ setShowReply={props.setShowReply}
markdownDomRef={props.markdownDomRef}
/>
</Show>
diff --git a/js/app/packages/block-email/component/MessageContainer.tsx b/js/app/packages/block-email/component/MessageContainer.tsx
index 5fb448a496..0baf6e7cde 100644
--- a/js/app/packages/block-email/component/MessageContainer.tsx
+++ b/js/app/packages/block-email/component/MessageContainer.tsx
@@ -27,15 +27,19 @@ interface MessageContainerProps {
export function MessageContainer(props: MessageContainerProps) {
const context = useEmailContext();
- const draftChild = createMemo(
- () => context.messageDbIdToDraftChildren[props.message.db_id ?? '']
- );
+ const draftChild = createMemo(() => {
+ const draft = context.messageDbIdToDraftChildren[props.message.db_id ?? ''];
+ if (!draft) return undefined;
+ return draft;
+ });
const [expandedHeader, setExpandedHeader] = createSignal<boolean>(false);
const [threadAppendMountTarget, setThreadAppendMountTarget] = createSignal<
HTMLElement | undefined
>();
- const [showReply, setShowReply] = createSignal<boolean>(false);
+ const [showReply, setShowReply] = createSignal<boolean>(
+ !!context.messageDbIdToDraftChildren[props.message.db_id ?? '']
+ );
const userId = useUserId();
const [currentUserName] = useDisplayName(userId());
@@ -101,68 +105,74 @@ export function MessageContainer(props: MessageContainerProps) {
});
return (
- <div class="macro-message-width w-full">
- <Message
- focused={isFocused()}
- isFirstMessage={isFirstMessage()}
- isLastMessage={isLastMessage()}
- senderId={props.message.from?.email}
- isNewMessage={isNewMessage()}
- >
- <Message.TopBar>
- <EmailMessageTopBar
- message={props.message}
- focused={isFocused()}
- setExpandedMessageBodyIds={props.setExpandedMessageBodyIds}
- isBodyExpanded={isBodyExpanded}
- expandedHeader={expandedHeader}
- setExpandedHeader={setExpandedHeader}
- setFocusedMessageId={context.setFocusedMessageId}
- setShowReply={setShowReply}
- isLastMessage={isLastMessage()}
- />
- </Message.TopBar>
- <Message.Body>
- <EmailMessageBody
- message={props.message}
- isBodyExpanded={isBodyExpanded}
- setExpandedMessageBody={(id) =>
- props.setExpandedMessageBodyIds(id, true)
- }
- setFocusedMessageId={context.setFocusedMessageId}
- />
- </Message.Body>
- <Show when={visibleAttachments().length > 0}>
- <div class="flex flex-row overflow-x-scroll my-1">
- <For each={visibleAttachments()}>
- {(attachment) => {
- if (attachment.db_id)
- return <EmailAttachmentPill attachment={attachment} />;
- }}
- </For>
- </div>
- </Show>
- </Message>
- <Show when={(showReply() || draftChild()) && !isLastMessage()}>
+ <div class="shrink-0 flex justify-center w-full">
+ <div class="macro-message-width w-full">
<Message
- focused={false}
- unfocusable
- senderId={userId()}
- isFirstMessage={false}
- isLastMessage={false}
- threadDepth={1}
- isFirstInThread
- isLastInThread
- shouldShowThreadAppendInput={createSignal(true)[0]}
- setThreadAppendMountTarget={(el) => setThreadAppendMountTarget(el)}
+ focused={isFocused()}
+ isFirstMessage={isFirstMessage()}
+ isLastMessage={isLastMessage()}
+ senderId={props.message.from?.email}
+ isNewMessage={isNewMessage()}
>
- <Message.TopBar name={currentUserName()} />
- <div class="h-4" />
+ <Message.TopBar>
+ <EmailMessageTopBar
+ message={props.message}
+ focused={isFocused()}
+ setExpandedMessageBodyIds={props.setExpandedMessageBodyIds}
+ isBodyExpanded={isBodyExpanded}
+ expandedHeader={expandedHeader}
+ setExpandedHeader={setExpandedHeader}
+ setFocusedMessageId={context.setFocusedMessageId}
+ setShowReply={setShowReply}
+ isLastMessage={isLastMessage()}
+ />
+ </Message.TopBar>
+ <Message.Body>
+ <EmailMessageBody
+ message={props.message}
+ isBodyExpanded={isBodyExpanded}
+ setExpandedMessageBody={(id) =>
+ props.setExpandedMessageBodyIds(id, true)
+ }
+ setFocusedMessageId={context.setFocusedMessageId}
+ />
+ </Message.Body>
+ <Show when={visibleAttachments().length > 0}>
+ <div class="flex flex-row overflow-x-scroll my-1">
+ <For each={visibleAttachments()}>
+ {(attachment) => {
+ if (attachment.db_id)
+ return <EmailAttachmentPill attachment={attachment} />;
+ }}
+ </For>
+ </div>
+ </Show>
</Message>
- <Portal mount={threadAppendMountTarget()}>
- <EmailInput replyingTo={() => props.message} draft={draftChild()} />
- </Portal>
- </Show>
+ <Show when={showReply() && !isLastMessage()}>
+ <Message
+ focused={false}
+ unfocusable
+ senderId={userId()}
+ isFirstMessage={false}
+ isLastMessage={false}
+ threadDepth={1}
+ isFirstInThread
+ isLastInThread
+ shouldShowThreadAppendInput={createSignal(true)[0]}
+ setThreadAppendMountTarget={(el) => setThreadAppendMountTarget(el)}
+ >
+ <Message.TopBar name={currentUserName()} />
+ <div class="h-4" />
+ </Message>
+ <Portal mount={threadAppendMountTarget()}>
+ <EmailInput
+ replyingTo={() => props.message}
+ setShowReply={setShowReply}
+ draft={draftChild()}
+ />
+ </Portal>
+ </Show>
+ </div>
</div>
);
}
diff --git a/js/app/packages/block-email/component/MessageList.tsx b/js/app/packages/block-email/component/MessageList.tsx
index 4c77177c53..746319ff30 100644
--- a/js/app/packages/block-email/component/MessageList.tsx
+++ b/js/app/packages/block-email/component/MessageList.tsx
@@ -19,7 +19,8 @@ export function MessageList(props: MessageListProps) {
return (
<div
- class="w-full flex-1 flex flex-col items-center overflow-y-scroll suppress-css-brackets"
+ class="pt-3 w-full flex-1 flex flex-col items-center overflow-y-scroll overflow-x-hidden suppress-css-brackets"
+ ref={context.setMessagesRef}
onscroll={(e) => {
// Don't load more if we're programmatically scrolling to a message
if (isScrollingToMessage() || !props.initialLoadComplete) return;
@@ -36,28 +37,23 @@ export function MessageList(props: MessageListProps) {
}
}}
>
- <div
- class="w-full pt-3 flex flex-col items-center"
- ref={context.setMessagesRef}
- >
- <Show when={context.threadMessagesResource()?.loading()}>
- <div class="flex items-center justify-center h-16 w-full">
- <CircleSpinner />
- </div>
- </Show>
- <For each={context.filteredMessages()}>
- {(message, index) => {
- return (
- <MessageContainer
- message={message}
- index={index}
- expandedMessageBodyIds={expandedMessageBodyIds}
- setExpandedMessageBodyIds={setExpandedMessageBodyIds}
- />
- );
- }}
- </For>
- </div>
+ <Show when={context.threadMessagesResource()?.loading()}>
+ <div class="flex items-center justify-center h-16">
+ <CircleSpinner />
+ </div>
+ </Show>
+ <For each={context.filteredMessages()}>
+ {(message, index) => {
+ return (
+ <MessageContainer
+ message={message}
+ index={index}
+ expandedMessageBodyIds={expandedMessageBodyIds}
+ setExpandedMessageBodyIds={setExpandedMessageBodyIds}
+ />
+ );
+ }}
+ </For>
</div>
);
}
diff --git a/js/app/packages/block-email/util/prepareEmailBody.ts b/js/app/packages/block-email/util/prepareEmailBody.ts
index 892846c52d..0fb82c24b3 100644
--- a/js/app/packages/block-email/util/prepareEmailBody.ts
+++ b/js/app/packages/block-email/util/prepareEmailBody.ts
@@ -23,6 +23,19 @@ import {
} from 'lexical';
import type { ReplyType } from './replyType';
+export function clearEmailBody(editor: LexicalEditor | undefined) {
+ if (!editor) return;
+ editor.update(
+ () => {
+ const root = $getRoot();
+ const paragraph = $createParagraphNode();
+ root.clear();
+ root.append(paragraph);
+ },
+ { tag: 'external' }
+ );
+}
+
export const APPEND_PREVIOUS_EMAIL_COMMAND = createCommand<{
replyingTo: MessageWithBodyReplyless | undefined;
replyType?: ReplyType;