Bug 496313 - Sent messages cannot be edited more than once.
Summary: Sent messages cannot be edited more than once.
Status: RESOLVED FIXED
Alias: None
Product: NeoChat
Classification: Applications
Component: General (show other bugs)
Version: 24.08.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
: 498016 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-11-15 17:29 UTC by Aaron
Modified: 2025-01-12 04:10 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron 2024-11-15 17:29:18 UTC
SUMMARY

Sent message can be edited without issue one time, either using s/g replacement or the edit button on the message. However, editing the message a second time fails with both methods. The s/g replacement for the second edit simply shows no change. Using the edit button for the second edit does not display original text to edit (although adding a new message in place of the original seems to be allowed). When using the s/g replacement method exclusively, the second failed edit attempt will cause the message to disappear for the user on other clients (Element). The recipient will receive the first edit.

STEPS TO REPRODUCE
1.  Send a message
2.  Edit the message
3.  Edit the message again (particularly with s/g)
4. Try to edit the message again

OBSERVED RESULT
Depending upon the number of edit attempts, subsequent edits are either simply not applied, or the message disappears for the sender on other Matrix clients (Element). The recipient only receives the first edit.

EXPECTED RESULT
One expects all subsequent edits to work as the first.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.3

ADDITIONAL INFORMATION
Comment 1 James Graham 2024-11-17 13:54:38 UTC
So editing using the hover button should always work, this is because the issue is the way in which Matrix handles edits. They're actually their own events, they just get hidden by Neochat.

If you want to check this for yourself switch on dev tools and click on show hidden events. You'll see that what you second s/ edit is doing is editing the replacement event because Neochat is not properly ignoring it when figuring out the event to edit.
Comment 2 Bug Janitor Service 2024-11-17 14:15:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/2009
Comment 3 Carl Schwan 2024-11-18 08:41:55 UTC
Git commit cee9058c77957e0cf61d30b55ee179fbd37752a4 by Carl Schwan, on behalf of James Graham.
Committed on 18/11/2024 at 08:41.
Pushed by carlschwan into branch 'master'.

Fix Sed Edits

Make sure that for multiple sed edits we grab the eventID of the original message not the replacement

M  +7    -2    src/models/actionsmodel.cpp

https://invent.kde.org/network/neochat/-/commit/cee9058c77957e0cf61d30b55ee179fbd37752a4
Comment 4 Aaron 2024-11-18 15:53:30 UTC
(In reply to James Graham from comment #1)
> So editing using the hover button should always work, this is because the
> issue is the way in which Matrix handles edits. They're actually their own
> events, they just get hidden by Neochat.

Perhaps it is the UI that is failing here using the hover button, rather than how Neochat is actually handling the edit. On the second edit just using the hover button, the original text is not displayed in the edit, just the "check" and "x" buttons.
Comment 5 John Kizer 2025-01-12 04:10:34 UTC
*** Bug 498016 has been marked as a duplicate of this bug. ***