28 Jan 2023 |
poljar | if my memory serves me, you can listen for UnknownEvent : https://github.com/poljar/matrix-nio/blob/main/nio/events/room_events.py#L223 | 21:05:15 |
poljar | though i'm not sure if you'll be able to do that for to-device events | 21:06:43 |
MTRNord | for to device it should be using the existing types for calls so hopefully I dont need it there. I got more stuck on parsing an unknownEvent to an event :D Somehow I dont seem to create it correctly :) | 21:09:35 |
MTRNord | ah I guess I never make the event inside of it due to how I build it :) | 21:10:49 |
MTRNord | In reply to @poljar:matrix.org though i'm not sure if you'll be able to do that for to-device events It seems like there indeed is no "unknown" type to use 🤔 | 21:14:59 |
MTRNord | Guess I will just work on a fork for now | 21:15:10 |
MTRNord | Hm how would I debug not receiving to_device messages at all ? 🤔 | 22:26:24 |
MTRNord | I see them being sent from element-call but no matter what I put as a "add_to_device_callback" handler I get none of them | 22:27:30 |
MTRNord | It seems like for some reason _run_to_device_callbacks in the Client class never gets called. I am not sure if I am missing something | 22:40:19 |
MTRNord | ah no. I am getting them. But in encrypted form it seems | 22:42:38 |
MTRNord | I somehow am seeing OlmEvent being passed to the callbacks. Not sure why however. The event itself seems sane on both sides. It just doesnt seem to get processed | 22:46:30 |
MTRNord | actually I guess it may be a broken olm? | 22:49:53 |
MTRNord | nope there is an olm instance present | 22:50:47 |
OdoItal | In reply to @mtrnord:midnightthoughts.space actually I guess it may be a broken olm? Very offhand guess because this sounds similar to a problem I encountered in thr dart library: your client may not have recieved (or even requested) the session keys to decrypt the message, if it hasn't been verified/cross-signed yet | 23:01:07 |
OdoItal | * Very offhand guess because this sounds similar to a problem I encountered in the dart library: your client may not have recieved (or even requested) the session keys to decrypt the message, if it hasn't been verified/cross-signed yet | 23:01:18 |
OdoItal | I haven't used nio for encryption yet tbh so I don't have any specific idea on which exsct functions to resolve that, but ideally it'd be somewhere in the documentation | 23:02:10 |
OdoItal | * I haven't used nio for encryption yet tbh so I don't have any specific idea on which exact functions to resolve that, but ideally it'd be somewhere in the documentation | 23:02:34 |
MTRNord | Ah the issue is apparently somewhere in the translation to the event type:
WARNING: nio.encryption: Received unsupported Olm event of type m.call.candidates
| 23:05:36 |
MTRNord | took me a while to get logging working | 23:05:44 |
MTRNord | seems like I need to add more if cases for the custom todevice events | 23:06:56 |
MTRNord | I think | 23:07:34 |
MTRNord | I am honestly not entirely sure still | 23:07:41 |
OdoItal | If I were in your shoes, I'd probably prioritize getting a debugger attached so I can inspect what's going on; I particularly dislike having to rely on log statements tbh | 23:09:22 |
MTRNord | In reply to @me:shahpaarth.com If I were in your shoes, I'd probably prioritize getting a debugger attached so I can inspect what's going on; I particularly dislike having to rely on log statements tbh well yes. This kinda evolved from "this cant take more than 5m to fix so a debugger isnt needed" to "ah heck. What am I missing" :D | 23:10:02 |
OdoItal | Classic :^) | 23:10:19 |
MTRNord | oh hey now it crashed because I am not doing pythong correct. progress :D | 23:10:40 |
MTRNord | I also hope nobody ever uses my bot since the mods I made to nio are totally breaking half of it :D This is not how I am supposed to handle to_device stuff looking at the code...
elif payload["type"].startswith("m.call"):
payload["sender"] = sender
return ToDeviceEvent.parse_event(payload)
I hope I dont cause a loop :D
| 23:13:42 |
MTRNord | I just want it to work and go to sleep at this point :) | 23:14:10 |
MTRNord | ok finally I got it working :D | 23:30:44 |
2 Feb 2023 |
| Emil T joined the room. | 12:19:50 |