7 Sep 2024 |
| @matrix-test-2:matrix.org joined the room. | 19:37:09 |
Alex | my matrix.org test account on moment/nio with that patch is also able to display your images | 19:41:58 |
nex (she/it) | Awesome | 19:43:46 |
Alex | probably also a good idea to add tests for the new header btw. i'm out for today, but i can test again tomorrow, if needed. thx for your efforts :) | 19:50:36 |
nex (she/it) | Yeah, I'm gonna do all the tests tomorrow, I'm nackered now | 19:53:10 |
9 Sep 2024 |
Paarth Shah - Github Maintainer | In reply to @nex:nexy7574.co.uk The review was two hours ago, so if it was going to be merged on a whim it would've been by now. I've marked it as a draft until I've given it a proper once-over just to make sure there's no confusion Whims notwithstanding, finally getting the time to test things myself now :^) | 00:49:58 |
Paarth Shah - Github Maintainer | In reply to @nex:nexy7574.co.uk that's gonna be a pain to fix Indeed it is, but I'm mostly though it rn | 02:05:36 |
Paarth Shah - Github Maintainer | In reply to @nex:nexy7574.co.uk that's gonna be a pain to fix * Indeed it is, but I'm mostly though it rn; just 7 failing tests left | 02:05:44 |
Paarth Shah - Github Maintainer | * Indeed it is, but I'm mostly though it rn; just 7 4 failing tests left | 02:15:17 |
Paarth Shah - Github Maintainer | oh lord there's test logic that relies on nonlocal 😵💫 | 02:21:33 |
Paarth Shah - Github Maintainer | Download image.png | 02:50:28 |
Paarth Shah - Github Maintainer | Bless | 02:50:29 |
Paarth Shah - Github Maintainer | nex (she/it): I've pushed directly to your branch for https://github.com/matrix-nio/matrix-nio/pull/520. I've gotten all tests passing, and I'll be adding tests for the new headers as well. Unless you have objections, I'll be merging this as soon as I have that done. | 03:06:23 |
Paarth Shah - Github Maintainer | Aaaand merged. | 03:18:03 |
Paarth Shah - Github Maintainer | Publication of 0.25.1 in progress | 03:39:07 |
| Paarth Shah - Github Maintainer changed the room topic to "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/" from "The nio matrix python library | Latest stable release 0.25.0 https://pypi.org/project/matrix-nio/ | Documentation: https://matrix-nio.readthedocs.io/en/stable/". | 03:42:03 |
Paarth Shah - Github Maintainer | * Publication of 0.25.1 in progress done! | 03:42:36 |
Paarth Shah - Github Maintainer | Huge thanks to nex (she/it) for doing the hard work, and Alex, tulir, and whoever else for testing! I'm glad I could help contribute to bring it over the finish line 🙂 | 03:44:54 |
Alex | nice, thx | 04:42:38 |
nex (she/it) | In reply to @me:shahpaarth.com Huge thanks to nex (she/it) for doing the hard work, and Alex, tulir, and whoever else for testing! I'm glad I could help contribute to bring it over the finish line 🙂 Can't say I did an awful lot to be fair, I started it and pushed in the suggestions of others :^) | 11:16:20 |
nex (she/it) | In reply to @me:shahpaarth.com nex (she/it): I've pushed directly to your branch for https://github.com/matrix-nio/matrix-nio/pull/520. I've gotten all tests passing, and I'll be adding tests for the new headers as well. Unless you have objections, I'll be merging this as soon as I have that done. Ah well, i could not object at 4am, but I didn't have any objections anyway 😂 | 11:17:34 |
Paarth Shah - Github Maintainer | In reply to @nex:nexy7574.co.uk Ah well, i could not object at 4am, but I didn't have any objections anyway 😂 Lmaooo yeah I figured that I should've kept our timezone differences in mind a bit, but after rereading some of your comments I figured you wouldn't object too hard :^) Though naturally if there's any follow up needed we can do that anyway (I might want to shore up the unit tests a teensy bit more for my own sanity) | 18:36:26 |
| @matrix-test-2:matrix.org left the room. | 18:57:51 |
10 Sep 2024 |
Alex | it's a really dirty hack, but if someone has to support both media apis for a while, this works for me: diff --git a/src/nio/client/async_client.py b/src/nio/client/async_client.py
index 730bc6b..2e3c4d5 100644
--- a/src/nio/client/async_client.py
+++ b/src/nio/client/async_client.py
@@ -877,6 +877,17 @@ class AsyncClient(Client):
logger.warning("Timed out, sleeping for %ds", wait)
await asyncio.sleep(wait)
+ if transport_resp.status == 404 and ( # retry unauthed media
+ path.startswith("/_matrix/client/v1/media")
+ ):
+ path = "/_matrix/media/v3/" + path[25:]
+ resp = await self._send(
+ response_class, method, path, data, response_data,
+ content_type, trace_context, data_provider, timeout,
+ content_length, save_to
+ )
+ return resp
+
await self.receive_response(resp)
return resp | 04:57:40 |
nex (she/it) | nio-bot just got an update to master where it does something similar, but preemptively checks that >=v1.11 is supported before returning the HTTP URL, because in a prior commit I made the client cache supported versions on first sync (actually, just before). This was how I originally wanted to implement it in nio but I wasn't sure if it'd be a good fit for the base library | 06:14:22 |
11 Sep 2024 |
ifiguero | Dirty hack all the way down | 23:33:01 |
nex (she/it) | It's only until everything else catches up :*)
| 23:46:28 |
12 Sep 2024 |
nex (she/it) | I just noticed, there is no /_matrix/client/v1/media/upload, it's still /_matrix/media/v3/upload, so uploading media with nio appears to be broken right now
| 02:35:34 |
nex (she/it) | If nobody's gotten to this in the morning, I'll open a PR (it's 3am, so I'm going to sleep first lol), but realistically this could be a one-line update | 02:36:49 |
nex (she/it) | #523 opened :) (cc Paarth Shah - Github Maintainer) | 12:38:14 |