Bug 479587 - Text is often replaced when an emoji is at the end of the line
Summary: Text is often replaced when an emoji is at the end of the line
Status: RESOLVED FIXED
Alias: None
Product: NeoChat
Classification: Applications
Component: General (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-10 00:10 UTC by Justin Zobel
Modified: 2025-03-06 14:54 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Zobel 2024-01-10 00:10:05 UTC
SUMMARY

Neochat flatpak from nightly builds. (About reads 24.01.90).


If I type some text into the text entry field e.g. `Hello my name is Justin :smiley` and complete the smiley emoji it sometimes replaces the entire text I've typed in with a single emoji.

STEPS TO REPRODUCE
1. Type text into entry bar with an emoji at the end

OBSERVED RESULT
All text in the entry field is replaced by an emoji

EXPECTED RESULT
Text is not replaced

Operating System: Solus 4.5
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.9-269.current (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 4750U with Radeon Graphics
Memory: 29.1 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 20Y1001SAU
System Version: ThinkPad P14s Gen 1
Comment 1 Justin Zobel 2024-01-10 00:19:26 UTC
Followup, this isn't 100% reproducible.
Comment 2 Justin Zobel 2024-01-10 00:22:39 UTC
Ah, I found a reproducible test case.

Type "Test 123 :grin <tab> <tab>"

It's the second tab that's replacing the text. I can Ctrl Z to undo the replacement, but I think this is definitely a bug that needs to be looked into, as not everyone will know you can Ctrl Z, and they might lose large lots of entered text.
Comment 3 James Graham 2024-03-25 19:31:35 UTC
I'm really struggling to replicate this, is it still happening for you on the latest release and/or master?
Comment 4 Bug Janitor Service 2024-04-09 03:48:18 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Justin Zobel 2024-04-09 06:05:41 UTC
Yes I still have this issue occur. It's not ever time.
Comment 6 Joshua Goins 2025-03-06 01:32:46 UTC
Confirmed as I have hit this and it drives me nuts!
Comment 7 Justin Zobel 2025-03-06 01:56:01 UTC
Yay, it's finally bugging someone who can do something about it! Muaahahah
Comment 8 Bug Janitor Service 2025-03-06 02:04:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/2174
Comment 9 Joshua Goins 2025-03-06 14:54:32 UTC
Git commit 79a3da3358a47c71bc937ab640faa667768aa896 by Joshua Goins.
Committed on 06/03/2025 at 14:47.
Pushed by redstrate into branch 'master'.

Stop emojis from destroying your message

This is easy to reproduce in the following scenario with a bunch of
half-completed emojis: ":a :a :a :a". Trying to complete anything but the last
one starts replacing parts of the message because it only considers the last
colon to the current completion identifier.

This change fixes that and said scenario can no longer cause a message
massacare. This bug doesn't seem to affect the other completions because their
searching in the string was correct, but I made sure they all share the same
index now.
FIXED-IN: 24.12.3

M  +7    -4    src/chatdocumenthandler.cpp

https://invent.kde.org/network/neochat/-/commit/79a3da3358a47c71bc937ab640faa667768aa896