AsamK / signal-cli

signal-cli provides an unofficial commandline, JSON-RPC and dbus interface for the Signal messenger.
GNU General Public License v3.0
3.22k stars 306 forks source link

sendReaction doesn't work in 0.12.8 #1449

Closed davidlang42 closed 9 months ago

davidlang42 commented 9 months ago

Using the sendReaction command returns a timestamp and appears to succeed, but the Android Signal client does not actually add/remove the reaction specified. It previously worked in 0.12.7

AsamK commented 9 months ago

It still works for me. Can you provide a verbose log with -v?

grafchen commented 9 months ago

same here, or my brain is just not big enough to comprehend what grapheme emoji clusters are

image

grafchen commented 9 months ago

me again, it seems to work on linux (Ubuntu 22.04.3 LTS) but not on windows any idea why?

AsamK commented 9 months ago

Ah, then this is an encoding issue. The official clients discard reactions that are not emoji characters.

On the command line you need to paste the actual emoji char and make sure that the terminal is configured to support Unicode characters. I think there have been issues on how to do this on Windows but I don't know how to do it.

davidlang42 commented 9 months ago

Sorry for the slow reply, I tried --verbose and found that:

Next I confirmed that the args I was passing to signal-cli were the same in both instances, using echo signal-cli ...args > file then comparing the files with cat -A, and they were in fact identical including the emoji, so I was passing the emoji argument to signal-cli correctly.

Checking env vars between the 2 I found the container was missing LANG=en_US.UTF-8, so fixing that (and correctly installing and generating the locales) fixed the issue: https://github.com/davidlang42/signal-bot/commit/016233bc7840221024561c10b183bbeedf30cd70

However, I would suggest that something upstream (likely in the java libsignal code) is failing the parse the incoming emoji unless the locale is set to en_US.UTF-8, which sounds like a bug to me.

Whether you make any changes/report upstream is up to you, but at least now this info might help anyone else who gets caught out by docker and locales again.