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

Support exclusive lists with GotoSocial 0.17 #808

Closed
VyrCossont opened this issue Sep 17, 2024 · 4 comments · Fixed by #817
Closed

Support exclusive lists with GotoSocial 0.17 #808

VyrCossont opened this issue Sep 17, 2024 · 4 comments · Fixed by #817
Labels
enhancement New feature or request

Comments

@VyrCossont
Copy link

Is your feature request related to a problem? Please describe.

GotoSocial's upcoming 0.17 release will include Mastodon-API-compatible exclusive lists. Phanpy already supports them on Mastodon instances through the "Hide posts on this list from Home/Following" list edit checkbox, and they work great.

Describe the solution you'd like

I'd love to see Phanpy add support for them with GtS 0.17 as well. API should be the same:

Feditext and Fedicat didn't hit any issues adding it, afaik.

@VyrCossont VyrCossont added the enhancement New feature or request label Sep 17, 2024
@graue
Copy link
Contributor

graue commented Sep 19, 2024

Looking into this. Have a question: how can I tell the server is a GoToSocial server?

According to GoToSocial's API docs, GET /api/v2/instance returns a version string such as:

"0.1.1 cb85f65"

If this is still the case for newer versions, it's not clear to me how a client can tell that it's dealing with version 0.17 of GTS as opposed to version 0.17 of Mastodon or something else. There's no other field that says the type of server software. By contrast, my account on pixelfed.social returns a version string of:

"3.5.3 (compatible; Pixelfed 0.12.3)"

...which allows Phanpy to determine that it's Pixelfed and, in principle (although Phanpy doesn't currently do this), to know that a feature is available in version 0.12 of Pixelfed but not version 0.11 of Pixelfed, etc.

@VyrCossont
Copy link
Author

VyrCossont commented Sep 19, 2024

@graue The Mastodon API isn't the correct way to determine a server's actual version. It doesn't even usually give you the correct Mastodon API version the server's trying to fake; iirc Pixelfed has some APIs that weren't in Mastodon 3.5 and is missing a bunch that were, and I'm not counting Pixelfed-specific extensions. (Pleroma/Akkoma have similar issues.) While there is a GtS option that will return a similar fake Mastodon version string, it's not on by default, because it's intended only for use with really broken clients.

I think the correct answer is to use NodeInfo. Every Fedi server and many non-Fedi servers support it, and it'll have name and version fields that give you the server's actual software, not the Mastodon version it might be pretending to be. Once you've got that info, you can then attempt an /api/v2/instance or /api/v1/instance call and see if the thing actually has a Mastodon-compatible API.

This is the approach Feditext uses: real version from NodeInfo, further details from instance API. (And it has an internal list of which API methods and parameters are available on which versions of which backends, so that both user-visible UI and invisible API calls can be disabled if they're not supported. For example, it won't show the exclusive list toggle on GtS 0.16.)

Side note: Pleroma/Akkoma have additional details in metadata in their NodeInfo docs on how the server is configured and what features are available, but I think some of it is duplicated in the instance API.

@graue
Copy link
Contributor

graue commented Sep 19, 2024

That makes sense. Too bad the NodeInfo protocol and schema don't seem to be supported by Masto.js and look rather complicated. It makes this a bigger task than it appeared to be.

Edit: Aha, I see why Masto.js doesn't support this: no stable release of Mastodon has the proper CORS headers to allow a client-side JS app to fetch the NodeInfo. The fix for the issue will be in Mastodon 4.3. Akkoma, Pixelfed, and GoToSocial don't have this problem.

graue added a commit to graue/phanpy that referenced this issue Sep 19, 2024
For Mastodon <=4.3 (all current stable releases of Mastodon), the
NodeInfo request will always fail due to mastodon/mastodon#23135 and
fall back to the existing behavior. For other server software, this will
allow for more accurate checking of feature availability.

Fixes cheeaun#808: adds support for exclusive lists with GoToSocial 0.17+.
@VyrCossont
Copy link
Author

no stable release of Mastodon has the proper CORS headers to allow a client-side JS app to fetch the NodeInfo. The fix for the issue will be in Mastodon 4.3. Akkoma, Pixelfed, and GoToSocial don't have this problem.

Ooof, never ran into this with a native client. At least it only affects Mastodon out of the ones you listed, and only temporarily, so you know that if you can't get a NodeInfo doc but can get an instance API, it's probably Mastodon. Sorry it's a bigger issue than it looked initially!

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

Successfully merging a pull request may close this issue.

2 participants