deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

Not fully downloaded message edit is lost

Open link2xt opened this issue 8 months ago • 7 comments

If you get a large message that is not fully downloaded, and then an edit message, you get the text replaced with an edit. Then when you download the full message, text gets replaced by the original instead of staying edited.

If the text of the message is edited (we know it because we show "Edited"), fully downloading the message should not replace the text with original.

EDIT: Reordered edits must be handled correctly also: https://github.com/chatmail/core/issues/6806#issuecomment-3005608761

link2xt avatar Apr 15 '25 02:04 link2xt

I've created a test that attempts to reproduce this bug. Test fails, which is expected.

When thinking about fixing this issue, this question comes up: what if two edit messages come in the wrong order? is there some mechanism to check the validity of edits sequence? An edit-chain? 😅

ivan-cx avatar Jun 25 '25 17:06 ivan-cx

edit requests come with timestamp, that is good enough for ordering and to ensure only the last edit is shown.

we use that timestamp at lots of similar changes, eg group name changes

r10s avatar Jun 25 '25 20:06 r10s

But when looking at handle_edit_delete(), i don't see that timestamp_sent of the edit participates in any logic. Probably this is another bug that should be fixed. ... It'd good to update timestamp_sent of the message from the edit and only apply edits with greater-or-equal timestamps.

iequidoo avatar Jun 26 '25 20:06 iequidoo

If no one else is working on this, I want dive deeper into this issue and try to fix it.

ivan-cx avatar Jul 07 '25 21:07 ivan-cx

If no one else is working on this, I want dive deeper into this issue and try to fix it.

I think we can use github's "Assignees" for this. Even if someone forgot to self-assign the task, they will be notified if they are subscribed to the repo.

iequidoo avatar Jul 08 '25 10:07 iequidoo

I think we can use github's "Assignees" for this. Even if someone forgot to self-assign the task, they will be notified if they are subscribed to the repo.

Sure, but I guess I do not have permission to assign 😄

Image

ivan-cx avatar Jul 08 '25 14:07 ivan-cx

assigning rarely is done anywhere here in the repo, and it's not neccessary. Just do a PR referencing this issue here, and try to bring it into reviewable state :)

hpk42 avatar Jul 10 '25 10:07 hpk42