Skip to content
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

Message can not be sent when load message use loadAndGetAllMessagesInChat #166

Closed
rookylu opened this issue Apr 29, 2021 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@rookylu
Copy link

rookylu commented Apr 29, 2021

Message can not be sent when loading message use loadAndGetAllMessagesInChat function
I load message size about 1100
Message be be sent after the data loaded

image

@rookylu rookylu added the bug Something isn't working label Apr 29, 2021
@edgardmessias
Copy link
Contributor

@lucipher , could you provide an exemple of code?

@rookylu
Copy link
Author

rookylu commented May 5, 2021

                   var res = await client.loadAndGetAllMessagesInChat(chatId, true);
                    if (res && res.length > 0) {
                        console.log("message length",res.length)
                        for (const message of res) {
                            let msg = await Sessions.formatMsg(client, message, true)
                            if (!message.fromMe && message.isGroupMsg) {
                                msg['from'] = message['author'];
                                msg['to'] = message['from'];
                            }

                            msgs.push(msg);
                        }
                    }

@edgardmessias

@rookylu
Copy link
Author

rookylu commented May 6, 2021

@edgardmessias

If the load number is more than 1000, it will get stuck and will not be able to send or receive messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants