You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll try to be as descriptive as possible, and please let me know if this is my issue. Attached is a video of what happens in the UI. I am using react-native. (Versions will be listed below).
I am using the Network Link Conditioner internet restriction tool to simulate Edge networks.
I wait for the message to be successful until I send the next message (I'm trying to prove it's not a race condition on the frontend)
When the message errors, it is because the channel.sendMessage() is throwing an error timeout of 3000ms exceeded (Code will be pasted below)
Even though the message occurs, my other account (Pikachu) actually receives the message fine.
Afterwards what happens is several of issues. If the user tries to resend the message it will error out because technically there is nothing to "resend". And when I refresh the page, there will be a duplicate message that comes. (This I need to dig a little bit more into).
I do have enableOfflineSupport turned on
Here is the code below, it is the default code from stream chat react native
In Channel.tsx:
const sendMessageRequest = async (
message: MessageResponse<StreamChatGenerics>,
retrying?: boolean,
) => {
try {
const updatedMessage = await uploadPendingAttachments(message);
const {
// ...default code
user,
...extraFields
} = updatedMessage;
if (!channel.id) {
return;
}
const mentionedUserIds = mentioned_users?.map(user => user.id) || [];
const messageData = {
attachments,
id,
mentioned_users: mentionedUserIds,
parent_id,
text: patchMessageTextCommand(text ?? '', mentionedUserIds),
...extraFields,
} as StreamMessage<StreamChatGenerics>;
let messageResponse = {} as SendMessageAPIResponse<StreamChatGenerics>;
if (doSendMessageRequest) {
// ...default code
} else if (channel) {
messageResponse = await channel.sendMessage(messageData);
}
if (messageResponse.message) {
// ...default code, it doesn't reach here
}
} catch (err) {
console.log(err) // THIS IS WHERE THE ERROR MESSAGE IS
message.status = MessageStatusTypes.FAILED;
updateMessage({...message, cid: channel.cid});
if (enableOfflineSupport) {
// ...default code
}
};
I'll try to be as descriptive as possible, and please let me know if this is my issue. Attached is a video of what happens in the UI. I am using react-native. (Versions will be listed below).
Problem
https://github.com/GetStream/stream-chat-js/assets/12720511/d641acfc-bd21-4493-92b6-1fcd282deea2
Please take a look starting at the 10 second mark. There are a couple of key points here:
channel.sendMessage()
is throwing an errortimeout of 3000ms exceeded
(Code will be pasted below)enableOfflineSupport
turned onHere is the code below, it is the default code from stream chat react native
In
Channel.tsx
:My package versions:
The
stream-chat-react-native
code is directly forked,[v5.15.0](https://github.com/GetStream/stream-chat-react-native/releases/tag/v5.15.0)
Thanks, please let me know if you need more information.
The text was updated successfully, but these errors were encountered: