!JiiOHXrIUCtcOJsZCa:matrix.org

nio

356 Members
The nio matrix python library | Latest release 0.6 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/139 Servers

Load older messages


SenderMessageTime
20 Sep 2024
@nex:nexy7574.co.uknex (she/it)https://github.com/matrix-nio/matrix-nio/blob/main/src/nio/api.py#L112620:18:50
@nex:nexy7574.co.uknex (she/it) does this function send a body at all? 20:18:55
@nex:nexy7574.co.uknex (she/it)* https://github.com/matrix-nio/matrix-nio/blob/main/src/nio/client/async_client.py#L254020:24:26
@me:shahpaarth.comPaarth Shah - Github Maintainer
In reply to @nex:nexy7574.co.uk
@Paarth Shah - Github Maintainer would you be able to make another release that includes the upload patch? even if its something like 0.25.1.post1? I need to be able to pin my package to a version that has the fixed upload because i've got a couple people complaining it isn't working now, but I don't really fancy pinning a release version to a git branch
Lemme do that rn
20:42:50
@nex:nexy7574.co.uknex (she/it)amazing, thank you 👐20:46:18
@nex:nexy7574.co.uknex (she/it)
In reply to@nex:nexy7574.co.uk
does this function send a body at all?
No, it doesn't, but I have fixed this. I'm not sure if this is an issue with just my homeserver or not, so unless other people are encountering a JoinError related to EOF in JSON, I'll leave it be
20:46:48
@me:shahpaarth.comPaarth Shah - Github Maintainer changed the room topic to "The nio matrix python library | Latest stable release 0.25.1 | Latest release candidate 0.25.2rc1 | https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/" from "The nio matrix python library | Latest stable release 0.25.1 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/".20:49:25
@me:shahpaarth.comPaarth Shah - Github Maintainer
In reply to @nex:nexy7574.co.uk
amazing, thank you 👐
https://pypi.org/project/matrix-nio/0.25.2rc1/
20:49:35
@me:shahpaarth.comPaarth Shah - Github MaintainerAnd no problem! I've been meaning to do that for a hot second lol20:49:54
@me:shahpaarth.comPaarth Shah - Github Maintainer * And no problem! I've been meaning to do that for a hot second lol; this will probably be mostly identical to the actual 0.25.2 once I get around to those release notes20:50:30
@nex:nexy7574.co.uknex (she/it)awesome, thank you!21:55:22
@fabian:alertrix.netFabian changed their display name from Fabian to Fabian ( @ matrixconf ).22:27:57
21 Sep 2024
@h5lbbz66i62qimho9kxh:matrix.org@h5lbbz66i62qimho9kxh:matrix.org joined the room.08:30:37
@h5lbbz66i62qimho9kxh:matrix.org@h5lbbz66i62qimho9kxh:matrix.org left the room.08:31:04
@nex:nexy7574.co.uknex (she/it) changed their profile picture.21:43:28
@ifiguero:matrix.orgifiguero

I have a question regarding the sync_forever regarding the gaps that are generated by the homeserver on the replies. I was made aware that when you sync, the since token is supposed to mark somewhat of a limit for the response, but the response is always from the latest events backwards in time.

This open some scenario where too many events might happen and the server reply might just be truncated, and your bot might miss some events due to that.

22:29:17
@ifiguero:matrix.orgifigueroScreenshot at 2024-09-19 17-33-16.png
Download Screenshot at 2024-09-19 17-33-16.png
22:29:49
@ifiguero:matrix.orgifigueroShould it be possible to detect when the returned batch generated a gap with your previous sync and request the trailing events while keep fetching the original sync?22:31:10
@ifiguero:matrix.orgifiguero I'm trying to device a way to handle it appropriately, but it feels like the homeserver endpoint is broken and can't be used for this porpuse. 22:34:55
22 Sep 2024
@anton.molyboha:matrix.organton.molybohaimage.png
Download image.png
08:00:04
@anton.molyboha:matrix.organton.molyboha

Yes, you can check the limited property of a timeline to see if there is a gap. You can then call sync using prev_batch property to fill in the gap.

(the screenshot is from https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv3sync)

08:00:53
@anton.molyboha:matrix.organton.molyboha Another approach is to use AsynClient.room_messages to continuously poll for new messages in a room. 08:06:16
@anton.molyboha:matrix.organton.molyboha * Another approach is to use AsyncClient.room_messages to continuously poll for new messages in a room. 08:06:30
@anton.molyboha:matrix.organton.molybohaWith both approaches you don't have automatic decryption of messages if you are in an encrypted room.08:26:05
@anton.molyboha:matrix.organton.molyboha Also, sync and room_messages may return messages in different order. 08:30:01
@nex:nexy7574.co.uknex (she/it) Is there a way to fetch power-levels on demand? for whatever reason, if I have store_sync_tokens set to True in my AsyncClientConfig, room data is entirely unpopulated on each restart, including users and their consequent power levels 11:35:42
@nex:nexy7574.co.uknex (she/it)image.png
Download image.png
11:38:34
@ifiguero:matrix.orgifiguero
In reply to @anton.molyboha:matrix.org

Yes, you can check the limited property of a timeline to see if there is a gap. You can then call sync using prev_batch property to fill in the gap.

(the screenshot is from https://spec.matrix.org/v1.11/client-server-api/#get_matrixclientv3sync)

The prev_batch is always sent to the sync endpoint. And it you do the math, the only way that you get a gap if you send the since is if the response returns the the newest events.
13:18:45
@ifiguero:matrix.orgifiguero1000053300.jpg
Download 1000053300.jpg
13:19:01
@ifiguero:matrix.orgifigueroI'm unsure how you should call for events in the gap. But I assume you require a custom implementation of the sync loop13:21:19

Show newer messages


Back to Room ListRoom Version: 4