lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Resolve proxied objects

Open ShadowJonathan opened this issue 2 years ago • 2 comments

Requirements

  • [X] Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a feature request? Do not put multiple feature requests in one issue.
  • [X] Is this a UI / front end issue? Use the lemmy-ui repo.

Is your proposal related to a problem?

Currently, when calling /resolve_object, we're able to resolve directly-corresponding URLs, such as https://lemmy.world/post/117881.

However, when giving it https://lemmy.ml/post/1248487, which is lemmy.ml's view of the above post, it chokes.

This is entirely understandable, however, this is confusing to users when it does not correctly "search", and more importantly, for non-browser native apps, there is no (easy) way of resolving these proxied post URLs.

Describe the solution you'd like.

Make /resolve_object be able to resolve "proxied" posts like this, via some mechanism, with which it can fetch the original post ID and instance from this proxied post.

Describe alternatives you've considered.

Scrape the HTML and reconstruct the original URL, throwing that at /resolve_object as well.

This falls apart as soon as there is a change in lemmy-ui, or if there's a different frontend.

Additional context

With Mlem, we're currently considering using /resolve_object to "guide" users to posts natively, instead of having to present a safari/browser context for the same post, which is confusing and frustrating to the user.

ShadowJonathan avatar Jun 15 '23 11:06 ShadowJonathan

Are you sure that's how the API works? For me, both the local post link and the original post link just lead to a generic site info return, but the API will resolve community links. I think that the /post is the path for the API that returns post information.

Edit: Actually my API may just be erroring. I need to look more into it.

Edit 2: Yeah, it was just my local API acting up.

TheSaneWriter avatar Jun 16 '23 00:06 TheSaneWriter

I'm currently working on a solution to this. Someone else might beat me to it, but I'll try to see if I can get something going.

TheSaneWriter avatar Jun 16 '23 21:06 TheSaneWriter

When is this change being deployed?

sallyFoster avatar Nov 02 '23 15:11 sallyFoster

It will be in 0.19 which will be released in the next weeks.

Nutomic avatar Nov 03 '23 10:11 Nutomic