this post was submitted on 21 Jun 2023
6 points (100.0% liked)

Lemmy Support

4656 readers
3 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

I'm working on a little tool for Lemmy using the rust backend (lemmy_api_common crate 0.17.4).

I've tested it against some 0.17.4 instances with no issues, but yesterday I went to test it more thoroughly on the official testing instances and had JSON parsing issues. I realized later that these servers are currently running 0.18.X.

Is this a bug? Or are we expecting that even within the "v3" APIs that you'll have breaking changes between Lemmy versions?

top 8 comments
sorted by: hot top controversial new old
[–] emily 3 points 1 year ago

same issue with the js api package

[–] [email protected] 3 points 1 year ago (1 children)

Fwiw, the api changed from 0.17.3 to 0.17.4, and then again to 0.18

I raised it a few times in various places but nobody seemed to care so i gave up complaining. At least hopefully eventually nobody will be running pre-0.18, and the js docs will be updated to be accurate

[–] CMahaff 1 points 1 year ago

This is the I formation I was looking for. Unfortunate, but I'll just have to role with it. Thanks for the info!

[–] [email protected] 2 points 1 year ago (1 children)

I've been working with the rust version of the API, and I can't really say I'm surprised. It's going to be sensitive to any fluctuation in type, and they probably don't want to inflate API versions every time they make a small change.

At least the compiler will tell you really quickly what's wrong and where to get it fixed. For most people, API wrappers will probably handle updating for the changes anyway.

[–] CMahaff 2 points 1 year ago (1 children)

Yeah the rust API also seems to be sometimes re-using database types in their structs vs creating new types just for the API, which is only going to make that problem worse.

I guess I should have checked if there was a library for it first - best of luck to any library writers trying to handle supporting dozens of minor releases though, sounds painful.

[–] [email protected] 2 points 1 year ago

That's correct, they're the same datatypes the server uses all over. Though, I don't think keeping it up to date would be that bad unless they seriously change things around all at once. Particularly if you encapsulate the data well for the end library user.

My project is making wrapper libraries around all of the types and implementing things based on that.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

Have you raised an issue on the main project on github? Sorry to be that guy, I don’t know the answer but you’ll get the best help there

[–] CMahaff 1 points 1 year ago

I probably should just do that - I just didn't want to waste their time if it's expected behavior.

load more comments
view more: next ›