!JiiOHXrIUCtcOJsZCa:matrix.org

nio

342 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/133 Servers

Load older messages


SenderMessageTime
26 Oct 2024
@fabian:alertrix.netFabian Hi, during my development of a django based application service I implemented a custom store class, which requires a synchronous context, which is not the case when using the AsyncClient, so i used asgirefs asgiref.sync.sync_to_async to mitigate django.core.exceptions.SynchronousOnlyOperation exceptions.
I would like to make these changes available to everyone in matrix-nio, i do not have any experience in working on other peoples projects yet, tho. Do i just push my branch ("synchronous-only-database") to github and create a pull request?
I have only tested it with the tests of my project so far. How do i run matrix-nio`s tests?
12:36:54
@ifiguero:matrix.orgifiguero I don't understand why you can't just call the sync method from your async function. I mean is non-ideal as you have some I/O delay but its not that you can't do it. 22:17:42
@nex:nexy7574.co.uknex (she/it)You can use the tox command to run the test suite13:10:51
27 Oct 2024
@fabian:alertrix.netFabian
In reply to @ifiguero:matrix.org
I don't understand why you can't just call the sync method from your async function. I mean is non-ideal as you have some I/O delay but its not that you can't do it.
Because it raises django.core.exceptions.SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async. and i could not get it to work any other way (tried asyncio.run(<sync-only function>) got exception related to threads like RuntimeError: Single thread executor already being used, would deadlock)
The docs also say something about thread-safety (makes sense in regards to race conditions, since the sync-only methods i came across so far are the ones talking to the database).
And since the sync methods that get called from AsyncClient are not awaited obviously, we cannot simply overwrite them with an async def in our custom store class nor use await in them (SyntaxError), so calling Djangos builtin async methods is impossible (they just use sync_to_async on the regular methods anyways).
09:53:41
@fabian:alertrix.netFabian changed their display name from Fabian ( @ matrixconf ) to Fabian.09:54:06
@clel:matrix.orgclelI have the suspicion that notifications from this room will kill the UI on my POCO X6 Android phone. It will require a full restart. I noticed a correlation in the past (but notifications on Element are often not showing up, anyway), might be wrong, though. Anyone else experienced this? 10:43:46
@ifiguero:matrix.orgifiguero
In reply to @clel:matrix.org
I have the suspicion that notifications from this room will kill the UI on my POCO X6 Android phone. It will require a full restart. I noticed a correlation in the past (but notifications on Element are often not showing up, anyway), might be wrong, though.
Anyone else experienced this?
I feel that is client dependant.
14:14:25
@clel:matrix.orgclel
In reply to @ifiguero:matrix.org
I feel that is client dependant.
What does that mean?
Just crashed again, BTW 😅😬
14:33:38
@ifiguero:matrix.orgifiguerothat will depend on what software you are using as a matrix client14:34:14
@clel:matrix.orgclel
In reply to @ifiguero:matrix.org
that will depend on what software you are using as a matrix client
Saw you were writing for reply, so quickly locked my phone to test again. It showed some weird notification symbol (battery without filling inside). Then crashed the UI again.
14:37:29
@clel:matrix.orgclelSo now I am pretty sure that this is triggered by it. 14:37:44
@clel:matrix.orgclelLet's see, if you reply again without the phone being locked, maybe it won't crash it. 14:38:09
@clel:matrix.orgclel
In reply to @ifiguero:matrix.org
that will depend on what software you are using as a matrix client
Am having both, Element and Element X installed.
14:38:50
@clel:matrix.orgclel
In reply to @clel:matrix.org
So now I am pretty sure that this is triggered by it.
Also saw similar correlation happen, before, but now the correlation is pretty convincing.
14:40:01
@clel:matrix.orgclelMaybe not related to the specific channel, though. 14:41:12
@nex:nexy7574.co.uknex (she/it)What's the difference between InviteMemberEvent and MemberEvent?22:36:38
28 Oct 2024
@ifiguero:matrix.orgifiguero
In reply to @nex:nexy7574.co.uk
What's the difference between InviteMemberEvent and MemberEvent?
in my experience, the invite doesn't have a server_timestamp field.
04:54:21
@fabian:alertrix.netFabianAfaik you receive an InviteMemberEvent for rooms that you have not joined yet.08:13:56
@tom:lant.uktom changed their display name from tom to tom [back 2024-11-04].09:35:02
@brendan:abolivier.bzhBrendan Abolivier changed their profile picture.11:51:25
@nex:nexy7574.co.uknex (she/it) changed their profile picture.15:23:14
30 Oct 2024
@nex:nexy7574.co.uknex (she/it) is next_batch really a required property? or would a PR to "fix" this warning be acceptable 11:20:41
@nex:nexy7574.co.uknex (she/it)WindowsTerminal_cc0sXZJilL.png
Download WindowsTerminal_cc0sXZJilL.png
11:20:42
@nex:nexy7574.co.uknex (she/it)
In reply to@nex:nexy7574.co.uk
is next_batch really a required property? or would a PR to "fix" this warning be acceptable
CC @Paarth Shah - Github Maintainer
16:32:53
31 Oct 2024
@shadowrz:nixos.dev夜坂雅 left the room.07:16:07
@nex:nexy7574.co.uknex (she/it) changed their display name from nex (she/it) to nex (she/it) 🎃👻.18:28:25
1 Nov 2024
@nex:nexy7574.co.uknex (she/it) changed their display name from nex (she/it) 🎃👻 to nex (she/it).00:34:08
@ifiguero:matrix.orgifiguero I set the logging verbosity to CRITICAL. Unless you care about malformed events or http timeouts. 01:56:03
@nex:nexy7574.co.uknex (she/it)I do a lot of testing with this bot and am currently using it to debug some server-side troubles, so both of those are in fact things I care about in this case03:36:10
@nex:nexy7574.co.uknex (she/it)Just seems like a bit of a useless warning though03:36:53

Show newer messages


Back to Room ListRoom Version: 4