!JiiOHXrIUCtcOJsZCa:matrix.org

nio

341 Members
The nio matrix python library | Latest stable release 0.25.2 | https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/132 Servers

Load older messages


SenderMessageTime
10 Oct 2024
@nex:nexy7574.co.uknex (she/it) changed their display name from using System; to use "fmt".23:33:18
11 Oct 2024
@nex:nexy7574.co.uknex (she/it) changed their display name from use "fmt" to nex (she/it).01:49:01
@ifiguero:matrix.orgifiguero something like that, because the client<->server is HTTP, you kinda go back and forth, and if the server don't reply your request in a timeout then you probably have to retry it. That is implented on the AsyncClient on the async def _send method that also handles being rate limited by the server. 15:39:54
@ifiguero:matrix.orgifiguerogiven that its perfectly normal to ger a server timeout once in a while, and that the method already handles the retry by itself. it might serve you to diagnose in case poor connection or overloaded homeservr.15:41:08
18 Oct 2024
@winduu:matrix.orgJosh

Question About Power Levels

To modify power levels in nio, we need to use room_put_state event_type = "m.room.power_levels".

AFAIK: Synapse requires sending the full power level dictionary to the server when making modifications. Otherwise, values that are not explicitly set might get overwritten (or deleted). Is that correct?

I can’t seem to find a straightforward way to access this information in the correct schema structure, other than by fetching room events and modifying the last power level event as a base. The clients (rooms) have a PowerLevels object, but it doesn’t seem to fully represent the server schema.

It would be helpful to have a function that returns the server schema from here, perhaps something like a to_dict or to_json function. (Easy to implement, happy to do it)

Additionally, it appears that power levels in the object aren’t synced correctly; they seem to get updated only partially (this might be a separate issue).

Am I on the wrong track here? I’d appreciate clarification before opening a ticket. ;)

12:42:29
13 Oct 2024
@nex:nexy7574.co.uknex (she/it) Hey @Paarth Shah - Github Maintainer, are you still working on that PR that converts the dataclasses to pydantic objects? 10:04:47
@nex:nexy7574.co.uknex (she/it)I'm encountering some pain with dataclass validation errors and it has breathed a new life in my desire for pydantic 🥴10:05:13
18 Oct 2024
@mooling:envs.netMooling | 木泠 What happens when I cannot receive messages from Matrix after setting next_batch in client.sync_forever(timeout=5, since=next_batch)? 12:48:57
@mooling:envs.netMooling | 木泠If since=next_batch is not set, my program works fine.12:50:01
@winduu:matrix.orgJosh nex (she/it): Off Topic question. When did you send this message? It says Sunday 13.10 but gets shown after may last message from today? 12:59:18
@nex:nexy7574.co.uknex (she/it)
In reply to@winduu:matrix.org

Question About Power Levels

To modify power levels in nio, we need to use room_put_state event_type = "m.room.power_levels".

AFAIK: Synapse requires sending the full power level dictionary to the server when making modifications. Otherwise, values that are not explicitly set might get overwritten (or deleted). Is that correct?

I can’t seem to find a straightforward way to access this information in the correct schema structure, other than by fetching room events and modifying the last power level event as a base. The clients (rooms) have a PowerLevels object, but it doesn’t seem to fully represent the server schema.

It would be helpful to have a function that returns the server schema from here, perhaps something like a to_dict or to_json function. (Easy to implement, happy to do it)

Additionally, it appears that power levels in the object aren’t synced correctly; they seem to get updated only partially (this might be a separate issue).

Am I on the wrong track here? I’d appreciate clarification before opening a ticket. ;)

Can you not room_get_state m.room.power_levels and modify that?
12:52:42
@winduu:matrix.orgJoshBildschirmfoto 2024-10-18 um 14.59.52.png
Download Bildschirmfoto 2024-10-18 um 14.59.52.png
13:00:11
@nex:nexy7574.co.uknex (she/it)don't quote me on the function name12:52:46
@nex:nexy7574.co.uknex (she/it)
In reply to@winduu:matrix.org
nex (she/it): Off Topic question. When did you send this message? It says Sunday 13.10 but gets shown after may last message from today?
october 13th, 2024, at 11:04AM BST
13:00:49
@nex:nexy7574.co.uknex (she/it)
In reply to@nex:nexy7574.co.uk
october 13th, 2024, at 11:04AM BST
Are you running synapse by any chance?
13:00:56
@nex:envs.netnex (she/it) joined the room.13:01:35
@nex:envs.netnex (she/it).13:01:43
@nex:envs.netnex (she/it)cmon backfill13:01:47
@nex:envs.netnex (she/it)image.png
Download image.png
13:02:00
@nex:envs.netnex (she/it) CC Josh 13:02:07
@nex:envs.netnex (she/it)I've got federation issues with synapse servers from my homeserver for some reason. Presumably something I've configured wrong. The event will have only just come through because of backfil13:04:24
@nex:envs.netnex (she/it) * I've got federation issues with synapse servers from my homeserver for some reason. Presumably something I've configured wrong. The event will have only just come through because of backfill13:04:25
@winduu:matrix.orgJoshAh thanks! (Ill answer in this thread). No, just using elements with matrix acc, no fed, thus i was wondering.  Ahh, ok, that is extreme strange behavior, it should not be possible to forge timing via federation or at all.  13:11:04
@winduu:matrix.orgJosh
In reply to @nex:nexy7574.co.uk
don't quote me on the function name
I certainly could, but that is an extra request, for data that already is or should be available - thus not straightforward. The web clients don't do it either. - This why I thought I'm maybe doing something wrong.
13:15:01
@ifiguero:matrix.orgifiguero
In reply to @winduu:matrix.org

Question About Power Levels

To modify power levels in nio, we need to use room_put_state event_type = "m.room.power_levels".

AFAIK: Synapse requires sending the full power level dictionary to the server when making modifications. Otherwise, values that are not explicitly set might get overwritten (or deleted). Is that correct?

I can’t seem to find a straightforward way to access this information in the correct schema structure, other than by fetching room events and modifying the last power level event as a base. The clients (rooms) have a PowerLevels object, but it doesn’t seem to fully represent the server schema.

It would be helpful to have a function that returns the server schema from here, perhaps something like a to_dict or to_json function. (Easy to implement, happy to do it)

Additionally, it appears that power levels in the object aren’t synced correctly; they seem to get updated only partially (this might be a separate issue).

Am I on the wrong track here? I’d appreciate clarification before opening a ticket. ;)

I was trying to figure out that also on myself. I think the only way to really know is to look in the synapse codebase (as the documentation don't say much) about what happens with values missing on modification. Other bots seems to "overwrite" the whole allow,deny field, but I'm unsure that can scale to the sizes required for the amount of home-servers you can find on a room.

I was thinking on just sending the "changes" with this method, but I haven't properly test it. Nor that I have any custom homeserver to try. Now to be able to do that, your software need to keep the "true state" stored on its own, and probably query the "room state" to see what keys needs to get updated. So your code can send an event and sync the "room state" to the "true state" desired.

Another way is just to blindly craft the event from your "true state" without any regard of the "room state" trying to overwrite it completely. My only worry is that you could (eventually) get an event size too large if the list of homeservers grow beyond a threshold.

15:24:35
@nex:nexy7574.co.uknex (she/it)
In reply to@winduu:matrix.org
I certainly could, but that is an extra request, for data that already is or should be available - thus not straightforward. The web clients don't do it either. - This why I thought I'm maybe doing something wrong.
you could probably pull it from sync(), but I see what you mean
13:17:26
22 Oct 2024
@mtrnord:midnightthoughts.spaceMTRNord (they/them)

Hi :) I am kinda new to python matrix nio and I am getting AttributeError: 'dict' object has no attribute 'type' for events returned using await client.room_get_state(room_id.room_id).

I am doing a for ... in loop over state.events where the dict in the error is the event out of the events list. On which I am trying to compare the type with a string.

13:11:12
@mtrnord:midnightthoughts.spaceMTRNord (they/them)Any ideas why that happens?13:11:18
@mtrnord:midnightthoughts.spaceMTRNord (they/them)printing the event shows the type being present13:11:26
@mtrnord:midnightthoughts.spaceMTRNord (they/them) * printing the event shows the type key being present 13:11:32

Show newer messages


Back to Room ListRoom Version: 4