Sender | Message | Time |
---|---|---|
22 Oct 2024 | ||
MTRNord (they/them) | I am doing if event.type == "event type": | 13:11:56 |
MTRNord (they/them) |
| 13:12:37 |
MTRNord (they/them) | *
| 13:12:59 |
tulir | python doesn't allow dict access with dots like javascript does | 13:13:40 |
MTRNord (they/them) | Ah. So its event["type"] ? | 13:14:17 |
tulir | yes, looks like nio doesn't parse the events into dataclasses or anything like that, so they're just raw dicts | 13:15:09 |
MTRNord (they/them) | Ok even pycharm assumed dot notation here :D but maybe it is confusing it with some other type | 13:15:41 |
MTRNord (they/them) | ah it seems like there is an Event class which exists and it might have thought this applies here | 13:16:08 |
nex (she/it) | In reply to@tulir:maunium.netEvents usually yes, but iirc state values don't have any dataclasses at all | 13:20:10 |
MTRNord (they/them) | Another thing for room messages which are redacted I am getting lots of:
when going backwards using I dont care about the content but I do care about the message existing in the resulting list of events. Will they still exist or does this error cause them to disappear? 🤔 | 17:46:27 |
26 Oct 2024 | ||
ifiguero | I'm familiar with the error message, and I was tracking it to: https://matrix-nio.readthedocs.io/en/latest/_modules/nio/events/misc.html
| 01:51:48 |
23 Oct 2024 | ||
nex (she/it) changed their profile picture. | 18:46:39 | |
26 Oct 2024 | ||
ifiguero | it happens most likely happen on events that have the `event.source['type']=='m.room.message' value, and for some reason don't have a valid payload. | 01:55:26 |
23 Oct 2024 | ||
nex (she/it) removed their profile picture. | 19:03:18 | |
26 Oct 2024 | ||
ifiguero | * it happens most likely happen on events that have the event.source\['type'\]=='m.room.message' value, and for some reason don't have a valid payload. | 01:55:41 |
23 Oct 2024 | ||
nex (she/it) set a profile picture. | 19:04:45 | |
26 Oct 2024 | ||
ifiguero | * it happens most likely happen on events that have the event.source['type']=='m.room.message' value, and for some reason don't have a valid payload. | 01:55:55 |
24 Oct 2024 | ||
nex (she/it) | Is there an easy way to get each state update from each SyncResponse? | 23:40:01 |
26 Oct 2024 | ||
ifiguero | there is several custom events, and malformed ones, as not all clients behave properly. | 01:58:51 |
24 Oct 2024 | ||
nex (she/it) | I don't want the events in this case, just state changes | 23:40:12 |
26 Oct 2024 | ||
ifiguero | IIRC there is m.room.member for changes in the user and ['m.room'. ('name' | 'topic' | 'avatar' | 'aliases' | 'canonical_alias' | 'encryption' | 'create' | 'join_rules' | 'history_visibility' | 'guest_access' | 'power_levels' | 'server_acl' | 'tombstone' | 'pinned_events')] seem to be room state changes. | 02:30:11 |
ifiguero | they are all events. You get a copy of the current value if you query:
| 02:34:38 |
ifiguero | * they are all events. You get a copy of the current value if you query:
but also they get relayed by normal sync as they come by. | 02:35:11 |
-=D3V1L=- joined the room. | 08:18:48 | |
Fabian | 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 | 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 (she/it) | You can use the tox command to run the test suite | 13:10:51 |
27 Oct 2024 | ||
Fabian | In reply to @ifiguero:matrix.orgBecause 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 changed their display name from Fabian ( @ matrixconf ) to Fabian. | 09:54:06 | |
clel | 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? | 10:43:46 |