Skip to content

Conversation

@awlui
Copy link
Collaborator

@awlui awlui commented May 1, 2024

Description

The problem appears to be that occasionally, pending(local) messages sometimes don't have the sender.userId on it. It resolves itself once the message successfully sends, but there is a brief moment in time, where we have a message and we don't know who it is from if we are only basing it off of userId.

Test Plan

Verify:
messages you send are grouped together if they are sent within the same minute.
messages you send are not grouped together with messages from other users.

@awlui awlui requested a review from mtdurling May 1, 2024 20:01

// group pending messages with any message type other than failed
// Given the above is true, group by timestamp and sender id
if ([message.sendingStatus, comparingMessage.sendingStatus].includes(SendingStatus.PENDING) &&
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixed a different bug, but will be obsolete/unnecessary with the new fix.

replyType = '',
}: GetMessagePartsInfoProps): OutPuts => {
currentUserId = undefined
}: GetMessagePartsInfoProps & { currentUserId?: string }): OutPuts => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentUserId will be undefined by default anyway right? Any reason to explicitly given it a default of undefined here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah no ur right, I had previously had it as null and refactored it to undefined

@mtdurling
Copy link

Any theories on why it's undefined sometimes on pending messages?

@awlui
Copy link
Collaborator Author

awlui commented May 1, 2024

Any theories on why it's undefined sometimes on pending messages?

its not undefined, its an empty string, and I haven'ttt got a clueeeeee lol

@awlui
Copy link
Collaborator Author

awlui commented May 1, 2024

it would seem they are somewhat aware of the problem themselves, they've dealt with it in some areas where they have defined isByMe

@awlui
Copy link
Collaborator Author

awlui commented May 1, 2024

This is the PR(sendbird#23), where they fix some undescribed bug caused by an incomplete definition of isByMe. They don't really say why its happening

message: CoreMessageType,
comparingMessage: CoreMessageType,
currentChannel?: GroupChannel,
currentUserId?: string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the group being used for before?

Copy link
Collaborator Author

@awlui awlui May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was used previously to determine grouping by read status, which we removed cause it was buggy on some clients(jinen's) and we weren't using read status anyways.
https://github.com/sendbird/sendbird-uikit-react/blob/main/src/utils/messages.ts

The usage was removed but the parameter got left in

@mtdurling
Copy link

Can you add a test plan? I know it's intermittent, but I think it will be helpful looking back on this PR.

@awlui
Copy link
Collaborator Author

awlui commented May 1, 2024

Can you add a test plan? I know it's intermittent, but I think it will be helpful looking back on this PR.

lol its unfortunate because there is no reliable repro. But, I'll add a test plan to make sure we didn't break anything

@awlui awlui merged commit b82210f into main May 1, 2024
awlui added a commit that referenced this pull request May 1, 2024
* [APP-7066] - consider local send status messages as current users'

* pr fb
awlui added a commit that referenced this pull request May 7, 2024
* [APP-7066] - consider local send status messages as current users'

* pr fb
mtdurling pushed a commit that referenced this pull request Jun 25, 2024
* [APP-7066] - consider local send status messages as current users'

* pr fb
mtdurling pushed a commit that referenced this pull request Jul 11, 2024
* [APP-7066] - consider local send status messages as current users'

* pr fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants