mautrix / signal

A Matrix-Signal puppeting bridge
GNU Affero General Public License v3.0
505 stars 75 forks source link

"Failed to bridge sticker, no incoming filename" #12

Closed rufflepot closed 3 years ago

rufflepot commented 3 years ago

I read in the features and roadmap that signal stickers going from Signal to Matrix should work.

What happened: Signal stickers from sticker packs within Signal are not sent/received from Signal via Synapse to the client for the reason "failed to bridge sticker".

Expected behavior: Stickers should be interpreted as a picture and transferred from Signal over to the client.

Stickers that are not part of the Signal sticker packs (such as those apps that make stickers looking like your face or whatnot) transfer perfectly in the form of a .png. Is Signal using some kind of in-house solution to stickers rather than sending them as pictures?

Since I'm uncertain what is sensitive data I redacted a few places. Please let me know if I missed something. I'm also not entirely sure what parts in one log aligns with parts of another so I may have posted too many lines. My apologies for that. The mautrix-signal log is the of course the one that states the original issue: "failed to bridge sticker". I am aware the log timings are visually off by an hour because I apparently didn't get the whole daylight saving time correct. The actual timing is correct though.

mautrix-signal logs (sensitive lines redacted to "USER"):

today at 6:12 PM [2020-11-11 17:12:48,912] [DEBUG@mau.portal.USER] Started handling message 1605114767421 by f0a2123e-166e-4279-8796-6e671047cf98
today at 6:12 PM [2020-11-11 17:12:49,256] [WARNING@mau.portal.USER] Failed to bridge sticker, no incoming filename: Attachment(width=512, height=512, caption=None, preview=None, blurhash='LLSia8~W%g_4^*s,%MR+x]ozV@ad', voice_note=False, content_type='image/webp', custom_filename=None, id='l85ANg_FU3aBX626N2Fz', incoming_filename=None, digest='EiKcBfDgYktjZSO08AE3VsWVFQJx8HvmHgH5Kpjysvk=', outgoing_filename=None)
today at 6:12 PM [2020-11-11 17:12:49,257] [DEBUG@mau.portal.f0a2123e-166e-4279-8796-6e671047cf98] Didn't get event ID for 1605114767421

signald logs:

today at 6:12 PM 17:12:23.404 [Thread-1] DEBUG io.finn.signald.ProtocolLogger - [WebSocketConnection] Sending keep alive...
today at 6:12 PM 17:12:23.517 [OkHttp https://textsecure-service.whispersystems.org/...] DEBUG io.finn.signald.ProtocolLogger - [WebSocketConnection] onMessage() -- response received, but no listener
today at 6:12 PM 17:12:48.806 [OkHttp https://textsecure-service.whispersystems.org/...] DEBUG io.finn.signald.ProtocolLogger - [WebSocketConnection] onMessage() -- incoming request
today at 6:12 PM 17:12:48.807 [**********84-receiver] DEBUG io.finn.signald.ProtocolLogger - [SignalServiceEnvelope] Our MAC: 08 ed 29 d4 f3 aa 61 55 93 4b
today at 6:12 PM 17:12:48.807 [**********84-receiver] DEBUG io.finn.signald.ProtocolLogger - [SignalServiceEnvelope] Thr MAC: 08 ed 29 d4 f3 aa 61 55 93 4b
today at 6:12 PM 17:12:48.807 [**********84-receiver] DEBUG manager-**********84 - Storing envelope to disk.
today at 6:12 PM 17:12:48.813 [**********84-receiver] DEBUG io.finn.signald.storage.AccountData - Saving account to disk
today at 6:12 PM 17:12:48.816 [**********84-receiver] DEBUG io.finn.signald.storage.AccountData - Saving account to disk
today at 6:12 PM 17:12:56.363 [OkHttp https://textsecure-service.whispersystems.org/...] DEBUG io.finn.signald.ProtocolLogger - [WebSocketConnection] onMessage() -- incoming request
today at 6:12 PM 17:12:56.364 [**********84-receiver] DEBUG io.finn.signald.ProtocolLogger - [SignalServiceEnvelope] Our MAC: 22 3d 8e 34 ea 14 48 8b bc c7
today at 6:12 PM 17:12:56.364 [**********84-receiver] DEBUG io.finn.signald.ProtocolLogger - [SignalServiceEnvelope] Thr MAC: 22 3d 8e 34 ea 14 48 8b bc c7
today at 6:12 PM 17:12:56.365 [**********84-receiver] DEBUG manager-**********84 - Storing envelope to disk.

synapse logs (sensitive lines redacted to "DOMAIN","@signal_USER":

today at 6:12 PM 2020-11-11 18:12:34,447 - synapse.access.http.8008 - 311 - INFO - GET-11817 - 192.168.0.1 - 8008 - {@signalbot:DOMAIN} Processed request: 30.005sec/-0.000sec (0.004sec, 0.001sec) (0.000sec/0.000sec/0) 376B 200 "GET /_matrix/client/r0/sync?timeout=30000&since=s39698_61752_392_3436_1669_12_352_10176_1&filter=0&set_presence=online HTTP/1.1" "Python/3.8 aiohttp/3.6.2" [0 dbevts]
today at 6:12 PM 2020-11-11 18:12:35,264 - synapse.handlers.presence - 348 - INFO - persist_presence_changes-306 - Persisting 11 unpersisted presence updates
today at 6:12 PM 2020-11-11 18:12:57,458 - synapse.rest.media.v1.upload_resource - 85 - INFO - POST-11849 - Uploaded content with URI 'mxc://DOMAIN/beKfuWbCSQrgqKRNCABhTwSi'
today at 6:12 PM 2020-11-11 18:12:57,459 - synapse.access.http.8008 - 311 - INFO - POST-11849 - 192.168.0.1 - 8008 - {@signal_USER:DOMAIN} Processed request: 0.043sec/-0.000sec (0.001sec, 0.004sec) (0.001sec/0.021sec/1) 67B 200 "POST /_matrix/media/r0/upload?filename=cjv9qiQtoRZ1hNOvRbtF&user_id=@signal_USER:DOMAIN HTTP/1.1" "Python/3.8 aiohttp/3.6.2" [0 dbevts]
today at 6:12 PM 2020-11-11 18:12:57,502 - synapse.access.http.8008 - 311 - INFO - GET-11850 - 192.168.0.1 - 8008 - {@signal_USER:DOMAIN} Processed request: 0.003sec/-0.000sec (0.004sec, 0.000sec) (0.000sec/0.000sec/0) 126B 200 "GET /_matrix/client/r0/rooms/%21QKEniOJKClzAoXZHDp%3ADOMAIN/state/m.room.power_levels?user_id=@signal_USER:DOMAIN HTTP/1.1" "Python/3.8 aiohttp/3.6.2" [0 dbevts]
today at 6:12 PM 2020-11-11 18:12:57,713 - synapse.access.http.8008 - 311 - INFO - PUT-11851 - 192.168.0.1 - 8008 - {@signal_USER:DOMAIN} Processed request: 0.178sec/-0.000sec (0.012sec, 0.001sec) (0.005sec/0.017sec/4) 59B 200 "PUT /_matrix/client/r0/rooms/%21QKEniOJKClzAoXZHDp%3ADOMAIN/send/m.room.encrypted/mautrix-python_R103%40T1605114777530?ts=1605114774962&user_id=@signal_USER:DOMAIN HTTP/1.1" "Python/3.8 aiohttp/3.6.2" [0 dbevts]
today at 6:12 PM 2020-11-11 18:12:57,796 - synapse.http.client - 381 - INFO - as-sender-signal-141 - Received response to PUT http://mautrix-signal:29328/transactions/1746?access_token=<redacted>: 200

P.S. I can't believe this works as well as it does. This futuristic bridging stuff is just insane. Good job!

PNRxA commented 3 years ago

@mkuhlmann this is amazing. Is there any way to support animated stickers with this fallback?

tulir commented 3 years ago

Animated stickers are supported

PNRxA commented 3 years ago

@tulir I've seen certain custom packs don't have animation in Element, I guess it might be a format issue. It just shows a static image (which is still great, before this fallback no message came through)

tulir commented 3 years ago

Animated stickers are APNG, so your client needs to support that to see any animation