-
Notifications
You must be signed in to change notification settings - Fork 332
fix: remove MessageType type from the SDK #3064
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
base: V7
Are you sure you want to change the base?
Conversation
SDK Size
|
@@ -291,9 +291,8 @@ export const useMessageActions = ({ | |||
const retry: MessageActionType = { | |||
action: async () => { | |||
dismissOverlay(); | |||
const messageWithoutReservedFields = removeReservedFields(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already remove the reserved fields on the Channel component in retrySendMessage
function so there's no point of doing it here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be used without relying on retrySendMessage
? If so, we should keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. i missed it. I will revert the change
@@ -756,20 +753,20 @@ const MessageListWithContext = (props: MessageListPropsWithContext) => { | |||
const showUnreadUnderlay = !!shouldShowUnreadUnderlay && showUnreadSeparator; | |||
|
|||
const wrapMessageInTheme = client.userID === message.user?.id && !!myMessageTheme; | |||
const renderDateSeperator = isMessageWithStylesReadByAndDateSeparator(message) && | |||
message.dateSeparator && <InlineDateSeparator date={message.dateSeparator} />; | |||
const renderDateSeperator = dateSeparators[message.id] && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not having dateSeparator
on our message
is now very breaking in terms of the fact integrators will no longer have a way of using this. The general idea was to remove the enriched properties from message
, but provide an alternative way to get them (and use them only where they're needed - for example, readBy
is really only used in MessageStatus
so there's no need for us to pass it to the entire message
).
isTargetedMessage={highlightedMessageId === message.id} | ||
lastReceivedId={ | ||
lastReceivedId === message.id || message.quoted_message_id ? lastReceivedId : undefined | ||
} | ||
message={message} | ||
onThreadSelect={onThreadSelect} | ||
readBy={readData[message.id]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up on the comment above, this would allow us to:
- Not have to drill props to every
Message
component (which is costly, because it forces a relatively expensive rerender of eachFlatList
item) - Have
renderItem
depend on lessprops
(which we want, because we want it to be as pure as possible)
The goal of the PR is to get rid of the
MessageType
type from the SDK and keep theLocalMessage
as the single source of truth for the message. This is in line with the LLC and React SDK. The group styles, date separators and the message readby are now sent separately and used separately.