[bug] /api/v1/instance, uri
property is a URI, instead of a bare domain #907
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs change/feedback
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#907
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Your setup
From source
Extra details
No response
Version
3.15.1-0-g7eec493
PostgreSQL version
No response
What were you trying to do?
At the /api/v1/instance endpoint the
uri
property (despite the name) is supposed to be just the domain of the server (https://docs.joinmastodon.org/entities/V1_Instance/#uri). No leading protocol, ports, etc.Spot-checking Mastodon API compatible servers shows this is the case for at least Pixelfed, Pleroma, Fedibird, Friendica, Iceshrimp.
Akkoma doesn't -- e.g., https://genserver.social/api/v1/instance, version "2.7.2 (compatible; Akkoma 3.15.1-0-g7eec493)", exposes the
uri
property as"https://genserver.social"
instead of the correct"genserver.social"
.What did you expect to happen?
No response
What actually happened?
No response
Logs
No response
Severity
No response
Have you searched for this issue?
what is the impact of this? including the protocol is more "correct" for a uri field imo, does including it cause any issues?
The impact is that clients that attempt to parse this property as a domain -- which, despite the name of the property, it is -- will fail to parse it, because the value is a URL.
From a client's perspective this is a non-recoverable error -- the server is returning bogus data, and trying to guess the server's intention is just as likely to result in more errors.
https://docs.joinmastodon.org/entities/V1_Instance/#uri is clear this is a domain, the description says "The domain name of the instance"
Other text properties in the v1 instance response that are URLs are explicitly called out as such in the documentation (e.g.,
thumbnail
(https://docs.joinmastodon.org/entities/V1_Instance/#thumbnail)).The Mastodon devs corrected the confusing property name in api/v2/instance, where the property is now called
domain
(https://docs.joinmastodon.org/entities/Instance/#domain). Their intent is clear, as the description for theurl
property in V1 and thedomain
property in V2 are identical.I guess I should rephrase the question - do there exist clients which fail on this specific deviation?
it's hard to imagine a scenario in which you'd fetch this URL and not already know the instance domain name
Irrelevant.
You can't just pick and choose which bits of the API spec you want to follow, and stuff random data in other properties and hope that clients will figure it out.
For example, Mastodon status IDs look like numbers, but are strings. You would not be following the Mastodon spec if you returned those IDs as JSON numbers instead of strings, however much you think they look like numbers.
it's actually very relevent! it's not common knowledge, but the entire activitypub spec and everything built on top is actually very up for interpretation. in fact, mastodon don't even have an API specification, it's a living document of how it behaves in the current moment
every piece of software actually does things slightly differently, and whilst not ideal, everyone does in fact pick and choose which parts to implement
point sorta being that we'd think more about if a "fix" was justified based on of anyone cared what the field is
"The domain name of the instance." (https://docs.joinmastodon.org/entities/V1_Instance/#uri) is crystal clear.
I know that Pachli (and by inheritance, Tusky) have code that is more complicated than it needs to be to work around this Akkoma bug. It was in the course of trying to simplify this code to follow the spec that I discovered Akkoma is not compliant.
so, to clarify:
could have been more easily answered with
it's much harder to prioritise what needs doing if the impact of things isn't made clear!
uri
property #908nikclayton referenced this issue2025-05-06 20:00:16 +00:00
uri
property #908uri
property #908uri
property #908fixed by #927