Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Person.inbox_url should be optional #179

Closed
TheBrokenRail opened this issue Sep 5, 2023 · 5 comments
Closed

Person.inbox_url should be optional #179

TheBrokenRail opened this issue Sep 5, 2023 · 5 comments

Comments

@TheBrokenRail
Copy link
Contributor

Person.inbox_url is specified as always non-null.

However, it is easy to discover, that Person.inbox_url is actually nullable. For instance, if you check, https://lemmy.world/api/v3/post/list?sort=Active, you'll notice that all of the PostView.creator objects are missing inbox_url fields.

@TheBrokenRail
Copy link
Contributor Author

Also Community.followers_url and Community.inbox_url are mislabeled. It seems #160 added these definitions.

Also, I'm using lemmy-js-client v0.18.3 with Lemmy v0.18.4, so it should be compatible.

@dessalines
Copy link
Member

These type definitions are auto-generated from the rust code, using ts-rs. It seems to be using a default of placeholder_url`: https://github.com/LemmyNet/lemmy/blob/main/crates/db_schema/src/source/person.rs#L47

@Nutomic is this a non-issue then? Or should inbox_url be made optional?

@TheBrokenRail
Copy link
Contributor Author

Maybe this is a bug with the Lemmy backend not sending the properties then?

All I know is that on all the instances I've tested with (https://lemmy.world and https://lemmy.ml both running v0.18.4), Person objects don't seem to contain inbox_url fields, which seems to contradict lemmy-js-client classifying it as non-null:

{
  "id": 122582,
  "name": "lwadmin",
  "avatar": "https://lemmy.world/pictrs/image/a23e1c40-a5e6-4b8c-ad42-72ff8ca274d4.png",
  "banned": false,
  "published": "2023-06-14T21:04:29.419798",
  "actor_id": "https://lemmy.world/u/lwadmin",
  "bio": "Lemmy World Admins\n\nFollow the mastodon account at [@LemmyWorld@mastodon.world](https://mastodon.world/users/LemmyWorld)! :)",
  "local": true,
  "banner": "https://lemmy.world/pictrs/image/a4eff995-66fe-4c0d-ac0d-40b4a912a4aa.webp",
  "deleted": false,
  "admin": true,
  "bot_account": false,
  "instance_id": 1
}

@Nutomic
Copy link
Member

Nutomic commented Sep 7, 2023

A while ago we marked them as #[serde(skip)] in Rust so they dont get sent over the api, because they are really only needed for federation. The placeholder was added because this was causing problems for the Rust client api (LemmyNet/lemmy#3362). Here is the same issue reported in ts-rs. Looks like we need to add #[ts(skip) in those cases. Im opening a PR for this.

@TheBrokenRail
Copy link
Contributor Author

This seems to have been fixed in #181.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants