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

Sending a message sometimes becomes slow on chats with many messages / sometimes draft is not removed #3738

Closed
hpk42 opened this issue Mar 27, 2024 · 6 comments · Fixed by #3739
Labels
bug Something isn't working
Milestone

Comments

@hpk42
Copy link
Contributor

hpk42 commented Mar 27, 2024

Those of you who are with me in some chat groups will have seen that i sometimes sent "double messages".
This happens because when i hit "CTRL-return" or click the send button in a group chat with many messages, it takes 3-10 seconds until the message is sent, and then i click a second time because i wrongly think i hadn't clicked it. Sometimes, the draft-message doesn't even go away.
In chats with only few messages, i do not experience the problem. It's smooth/swift there.
Sometimes it seems to be even fast in chats with many messages.

It's all the same database, so my best guess it that something in the sending-logic (changing a draft message to a sent one) might iterate over all messages in a chat. But whatever the guess, it would be great if someone more knowledgable of the code can take a look into what happens when the send-button is clicked.

image

@hpk42 hpk42 added the bug Something isn't working label Mar 27, 2024
@hpk42 hpk42 changed the title Sending a message becomes very slow on chats with many messages / sometimes draft is not removed Sending a message sometimes becomes slow on chats with many messages / sometimes draft is not removed Mar 27, 2024
@Simon-Laux Simon-Laux added this to the New composer milestone Mar 27, 2024
@Simon-Laux
Copy link
Member

It's all the same database, so my best guess it that something in the sending-logic (changing a draft message to a sent one) might iterate over all messages in a chat.

if so its core being slow with sending as the code waits for core.

Anyways this code area is in high need of rewriting. see https://github.com/deltachat/deltachat-desktop/milestone/9

@hpk42
Copy link
Contributor Author

hpk42 commented Mar 27, 2024 via email

@Simon-Laux
Copy link
Member

Simon-Laux commented Mar 27, 2024

so on android you never have delays while sending?
I have a hard time imagining that desktop ui code has delays that depend on message count in the chat as unless you scrolled to load messages only the most recent 20 or so messages are even loaded and displayed in the ui, but even then it should have nothing to do with sending.

@hpk42
Copy link
Contributor Author

hpk42 commented Mar 27, 2024 via email

@hpk42
Copy link
Contributor Author

hpk42 commented Mar 27, 2024

currently things are super-fast. I'll close this issue and try to come back with a clearer way to reproduce as apparently no one else seems to experience the issue.

@hpk42 hpk42 closed this as completed Mar 27, 2024
@Simon-Laux
Copy link
Member

you already reported the delays before in #3586

#3739 might fix the double sending aspect by fixing the lock

To really make this nice we need to rewrite the composer, but we don't have time for that soon (maybe may if we are lucky with the other things). So let's test #3739 to at-least fix the double sending.

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

Successfully merging a pull request may close this issue.

2 participants