-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Draft is cleared before the message is saved to the database #3489
Comments
I think that is kinda ok for a corner case, a blocking UI don't letting you type the next message and an spinning sending button is not much better |
We may not block the UI, but just disable the Send button temporarily. If the user wants to type the next message, they can clear the input field manually or do whatever they want with the draft. Then before clearing the draft Delta Chat should only check that it hasn't changed. And if the draft is lost, the user should blame themselves. |
that is even worse, a good compromise would be clearing the draft but the send button turning to spinning, even then you can't use the attach button then and notice that when I said "blocking the UI" I didn't meant that the UI is frozen, but if you can't draft or send a new message in the meanwhile that is "blocking" you |
Clearing the draft before it's sent is a way to lose it. And then it seems the spinning Send button isn't a solution. Is the idea of combining the Attach and Send buttons good at all? Sometimes i forget that it works this way, type a text and then understand that i can't attach an image. Sometimes i understand while typing a text that i picked the wrong image and want to replace it, then i need to select all the text, cut it, change the attachment and paste the text. Telegram has the same problem. But e.g. WhatsApp doesn't combine these buttons. If we do the same, we may block (make spinning) only the Send button while sending the draft and the user can type text and use the Attach button. EDIT: In DC Desktop we also don't combine these buttons and i'd say that's more convenient. Why can't we unify things here? |
changing the combination of attach button and send button just to show an spinning icon is an overkill, but it will also mean we remove the draft so it doesn't solve the original problem, I guess it would really need to block and not allow editing so if message fails to be created, the draft is preserved under what conditions would message actually fail to create? i have never had this problem in android |
Not just to show a spinning icon, but also to unify UIs with Desktop.
I also haven't had this problem, but at least the chat may change its state to "can't send", e.g. a race happens and an incoming message breaking the chat protection arrives. It should be possible to accept the broken protection then and send the draft again. |
Here the draft is removed before the message is saved to the database:
deltachat-android/src/main/java/org/thoughtcrime/securesms/ConversationActivity.java
Lines 1006 to 1011 in 8c89c3e
If processing takes long, as may happen for images on slow devices, this results in the message disappearing from the compose area but not appearing in the chat for a noticeable time.
The way to fix this is probably to disable the send button and only clear the draft and re-enable the button when
sendMsg
returns.This is also a problem because
sendMsg
may fail for some reason and then the draft is lost. In Desktop this is fixed: deltachat/deltachat-desktop#4340Forum thread:
https://support.delta.chat/t/the-behavior-of-the-message-block-when-sending/3388
The text was updated successfully, but these errors were encountered: