@grishka hi, i just noticed a problem with the `tag` field in your Note. in mastodon and pleroma, that field is an array, so it would be much easier if smithereen could send it in the same way.
@felix yes I can do that, I think I send it as an object when it's only one item, thanks
Maybe fix federation with Lemmy 路 grishka/Smithereen@b95ae2e

Federated, ActivityPub-compatible social network server with friends, walls, and groups. - Maybe fix federation with Lemmy 路 grishka/Smithereen@b95ae2e

@felix it feels like I crashed lemmy.ml trying to extract an AP ID for a comment to try fetching one 馃檲
@grishka no there is a bug in the frontend so it keeps crashing. doesnt affect federation, thats all in the backend (which is stable cause of rust).

@grishka and comment ap id is like below, not whats linked in the ui.

https://lemmy.ml/comment/92432

@felix yeah this works now but only up the thread because there's no `replies` collection. Also a reminder that I should be validating `url` as having the same domain as `id`, right now it makes for something very confusing
@grishka so many things to add haha
@felix I refactored quite a lot of my web-related code to save myself some sanity, especially with pagination, and somehow it all didn't blow up. Still not sure I'm 100% done though. Also preparing for eventually having a REST API, so there needs to be an additional abstraction layer where all the logic resides, between the route handlers and the database helpers.
@grishka i basically had to rewrite our entire federation code over the last months, because the original one was extremely unmaintainable. luckily we have our frontend and backend cleanly separated though.
@felix been there, done that. It used to be a bunch of if statements, now I have proper classes, neatly organized by activity types they handle:
https://github.com/grishka/Smithereen/tree/master/src/main/java/smithereen/activitypub/handlers
Smithereen/src/main/java/smithereen/activitypub/handlers at master 路 grishka/Smithereen

Federated, ActivityPub-compatible social network server with friends, walls, and groups. - Smithereen/src/main/java/smithereen/activitypub/handlers at master 路 grishka/Smithereen

@grishka this is my code. its great because a lot of things can be verified at compile time. and thanks to rust i dont have to write any (de)serialization code, just a derive annotation.

https://github.com/LemmyNet/lemmy/blob/main/crates/apub/src/protocol/activities/following/follow.rs

https://github.com/LemmyNet/lemmy/blob/main/crates/apub/src/activities/following/follow.rs

lemmy/follow.rs at main 路 LemmyNet/lemmy

馃悁 Building a federated link aggregator in rust. Contribute to LemmyNet/lemmy development by creating an account on GitHub.

@felix I *could* also not do manual serialization thanks to Gson, which uses reflection to convert Java objects straight to and from json, but in this particular case I don't trust it 馃ぃ
@grishka yeah reflection isnt great. honestly i dont want to go back to java (or any other language) after using rust.
@felix I did try rust recently, and the error handling (all this Result<err> stuff) is kinda alien to me after 10 years of dealing mainly with exceptions lol. Way too much to change in my established way of thinking.
But I guess it's a good language to write an operating system in, should I ever want to do that 馃ぃ
Those memory-mishandling-related bugs and vulnerabilities in modern OSes due to them being written mainly in C/C++ seem unending.
@grishka not only that, you also dont get anything like nullpointerexceptions. which i had to debug all the time when i was still doing android development. basically, once rust compiles, it works (except for high-level logic errors which are usually easy to fix).

@felix depends on the codebase really. If you annotate things with Nullable/NotNull, you'll get warnings where there could be a null and you're dereferencing it without checking. I don't get many NPEs these days.

> once rust compiles, it works
except when it panics ;)