!JiiOHXrIUCtcOJsZCa:matrix.org

nio

324 Members
The nio matrix python library | Latest release 0.20.0 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/134 Servers

Load older messages


SenderMessageTime
28 Jan 2023
@poljar:matrix.orgpoljar 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:matrix.orgpoljarthough i'm not sure if you'll be able to do that for to-device events21:06:43
@mtrnord:midnightthoughts.spaceMTRNordfor 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:midnightthoughts.spaceMTRNordah I guess I never make the event inside of it due to how I build it :)21:10:49
@mtrnord:midnightthoughts.spaceMTRNord
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:midnightthoughts.spaceMTRNordGuess I will just work on a fork for now21:15:10
@mtrnord:midnightthoughts.spaceMTRNord Hm how would I debug not receiving to_device messages at all ? 🤔 22:26:24
@mtrnord:midnightthoughts.spaceMTRNordI see them being sent from element-call but no matter what I put as a "add_to_device_callback" handler I get none of them22:27:30
@mtrnord:midnightthoughts.spaceMTRNord 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:midnightthoughts.spaceMTRNordah no. I am getting them. But in encrypted form it seems22:42:38
@mtrnord:midnightthoughts.spaceMTRNordI 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 processed22:46:30
@mtrnord:midnightthoughts.spaceMTRNordactually I guess it may be a broken olm?22:49:53
@mtrnord:midnightthoughts.spaceMTRNordnope there is an olm instance present22:50:47
@me:shahpaarth.comOdoItal
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
@me:shahpaarth.comOdoItal* 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 yet23:01:18
@me:shahpaarth.comOdoItalI 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 documentation23:02:10
@me:shahpaarth.comOdoItal* 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 documentation23:02:34
@mtrnord:midnightthoughts.spaceMTRNord

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:midnightthoughts.spaceMTRNordtook me a while to get logging working23:05:44
@mtrnord:midnightthoughts.spaceMTRNordseems like I need to add more if cases for the custom todevice events23:06:56
@mtrnord:midnightthoughts.spaceMTRNord I think 23:07:34
@mtrnord:midnightthoughts.spaceMTRNordI am honestly not entirely sure still23:07:41
@me:shahpaarth.comOdoItalIf 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 tbh23:09:22
@mtrnord:midnightthoughts.spaceMTRNord
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
@me:shahpaarth.comOdoItalClassic :^)23:10:19
@mtrnord:midnightthoughts.spaceMTRNordoh hey now it crashed because I am not doing pythong correct. progress :D23:10:40
@mtrnord:midnightthoughts.spaceMTRNord

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:midnightthoughts.spaceMTRNordI just want it to work and go to sleep at this point :)23:14:10
@mtrnord:midnightthoughts.spaceMTRNordok finally I got it working :D23:30:44
2 Feb 2023
@emil_t:matrix.orgEmil T joined the room.12:19:50

There are no newer messages yet.


Back to Room List