Bug 457521 - ibus-ui-emojier-plasma shows no emojis with error "Your dict format is no longer supported."
Summary: ibus-ui-emojier-plasma shows no emojis with error "Your dict format is no lon...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Emoji Selector (show other bugs)
Version: 5.25.4
Platform: OpenMandriva Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-05 12:18 UTC by Bernhard Rosenkränzer
Modified: 2022-08-09 15:57 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkränzer 2022-08-05 12:18:14 UTC
ibus-ui-emojier-plasma shows just a blank selection window without any emoji (even though the Noto Emoji and Noto Color Emoji fonts are installed and configured properly).

If it is launched from konsole, it complains about:

(process:1601754): IBUS-CRITICAL **: 14:12:06.861: ibus_serializable_deserialize_object: assertion 'g_type_is_a (type, IBUS_TYPE_SERIALIZABLE)' failed
Your dict format is no longer supported.
Need to create the dictionaries again.

The dict is generated by the latest ibus, so "no longer supported" doesn't sound right. The gtk ibus-ui-emojier provided by ibus works in the same setup with the same dicts.

Plasma 5.25.4
Frameworks 5.96.0
ibus 1.5.26
Qt 5.15.5 with patches from the KDE branch from a couple of days ago

QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus

ibus-daemon launched with
/usr/bin/ibus-daemon --xim --desktop=kde --panel=/usr/lib64/libexec/kimpanel-ibus-panel --emoji-extension=/usr/bin/ibus-ui-emojier-plasma
Comment 1 Bernhard Rosenkränzer 2022-08-05 20:12:20 UTC
If I change
https://invent.kde.org/plasma/plasma-desktop/-/blob/master/applets/kimpanel/backend/ibus/emojier/emojierplugin.cpp#L116
to "continue;", the problem goes away.
Apparently there's a non-emoji object at the very beginning of emoji-en.dict, and skipping over it allows the remaining bits and pieces to work.

This may well be related to the other error spewed just ahead:
(process:1601754): IBUS-CRITICAL **: 14:12:06.861: ibus_serializable_deserialize_object: assertion 'g_type_is_a (type, IBUS_TYPE_SERIALIZABLE)' failed

Something non-serializable at the beginning of the dictionary, before the data we're interested in.

I don't know the file format of those dictionaries, but xxd looks like the dictionary starts with an empty IBusEmojiData followed by the real ones.
00000000: 4942 7573 456d 6f6a 6944 6174 6100 0500  IBusEmojiData...
00000010: 4942 7573 456d 6f6a 6944 6174 6100 0000  IBusEmojiData...
00000020: f09f 9880 0000 0000 0400 0000 6661 6365  ............face
00000030: 0073 6d69 6c69 6e67 0067 7269 6e6e 696e  .smiling.grinnin
00000040: 6720 6661 6365 0067 7269 6e00 6772 696e  g face.grin.grin
00000050: 6e69 6e67 2066 6163 6500 536d 696c 6579  ning face.Smiley
00000060: 7320 2620 456d 6f74 696f 6e00 4a3c 3729  s & Emotion.J<7)
00000070: 2115 100e 0028 7361 7b73 767d 7375 7373  !....(sa{sv}suss
00000080: 7373 7373 2900 0000 4942 7573 456d 6f6a  ssss)...IBusEmoj
[...]

Note the first line of xxd output.

Since it can't hurt to skip over invalid(?) or misinterpreted data, I'll add this patch to our package for now.
Comment 2 Nate Graham 2022-08-05 20:14:07 UTC
Please feel free to submit the patch upstream so everyone can benefit!
Comment 3 Bernhard Rosenkränzer 2022-08-05 20:16:45 UTC
Sure, will do -- just waiting for feedback to see if this is the right thing to do, given I don't really understand ibus.

I suspect the right fix is to remove the bogus entry at the beginning of the dictionary in ibus, but even then it can't hurt to make the plasma implementation more resilient against such errors.
Comment 4 Nate Graham 2022-08-05 20:17:33 UTC
Agreed on both counts.
Comment 5 Bug Janitor Service 2022-08-05 20:24:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1076
Comment 6 Aleix Pol 2022-08-09 15:32:09 UTC
Git commit 925aecd865c85dc43bdf3ec5491752130f52bdb6 by Aleix Pol Gonzalez, on behalf of Bernhard Rosenkränzer.
Committed on 09/08/2022 at 15:20.
Pushed by ngraham into branch 'master'.

Fix emojier displaying a blank window with ibus 1.5.26

Skip over invalid entries in a dictionary instead of throwing
the whole dictionary away.

Also change the qWarning() message to reflect the new reality.
FIXED-IN: 5.26

M  +3    -4    applets/kimpanel/backend/ibus/emojier/emojierplugin.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/925aecd865c85dc43bdf3ec5491752130f52bdb6
Comment 7 Nate Graham 2022-08-09 15:57:26 UTC
Git commit 58f34488426f041f0b185bfd0fbcf049b2119e64 by Nate Graham, on behalf of Bernhard Rosenkränzer.
Committed on 09/08/2022 at 15:57.
Pushed by ngraham into branch 'Plasma/5.25'.

Fix emojier displaying a blank window with ibus 1.5.26

Skip over invalid entries in a dictionary instead of throwing
the whole dictionary away.

Also change the qWarning() message to reflect the new reality.
FIXED-IN: 5.26


(cherry picked from commit 925aecd865c85dc43bdf3ec5491752130f52bdb6)

M  +3    -4    applets/kimpanel/backend/ibus/emojier/emojierplugin.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/58f34488426f041f0b185bfd0fbcf049b2119e64