MastoAPI quote incompatibility #1009
Labels
No labels
approved, awaiting change
broken setup
bug
cannot reproduce
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
not our bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma#1009
Loading…
Add table
Add a link
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?
We long had
quoteandquote_idas additional parameters in status responses for our quote post support. Ourquote_idis, well theidof the quoted post, andquotean inlined rendering of the quoted post similar to howreblogfrom vanilla MastoAPI works. Notably these additional fields are directly in the top-level namespace of the statuses, not in theakkomaorpleromasub namespaces like most other extensions. Presumably it was assumed, since it mirrors existingreblogsemantics, vanilla Mastodon would use the same layout if it ever gains quote support in the future.Recent’ish vanilla Mastodon actually added support for quote posts, but with a bespoke "quote authorisation" mechanism. Predictable now a
quoteparameter was added to status responses, but it is not just an inlined rendering of a status, but a special new object also containing information about the "authorisation" status of the quote.See https://docs.joinmastodon.org/client/quotes/ and in particular https://docs.joinmastodon.org/entities/Quote/ and https://docs.joinmastodon.org/entities/ShallowQuote/
(i would have liked to add a full JSON response for a vanilla Mastodon quote post, buts it’s actually not easy to even find a Mastodon quote post in the first place)
This means, we’re likely to run into compat issues with vanilla Mastodon clients soon™. However, we cannot just swap our format over to match Mastodon’s either since this would break all existing clients using the established *oma response format for quotes.
Not sure what the best path forward here is.
(Note this is not about creating quote posts or supporting the quote ""authorisation"" mechanism, only about how existing quote posts are encoded in API responses)
As pointed out in this comment, there’s no overlap between the keys of "status" and the new "(shallow) quote" objects and we can hack in compatibility for both response formats by just filling out
quotewith a full "status"-type MastoAPI object like we do atm, but additionally set the two fields used in Mastodon’squoteresponse format:To avoid too much duplication and bloat we can probably just stick with always using the "shallow" format with just
quoted_status_idinstead of a fullquoted_statussub-object.(
"accepted"is ofc not necessarily technically correct if the quoted post comes from an instance performing manual approvals, but needed for client API compatibility)Nope. Tusky, the first client I know actually using Masto quotes, only handles non-shallow quotes (thanks to kopper for pointing this out), meaning we unfortunately need to dupe the whole object :\
THis is particularly bad since it inlines the author as
accountand the account contains full nodeinfo inakkoma.instance.nodeinfo.Surveying common frontends and clients it appears only akkoma-fe is making use of
akkoma.instanceatm and it only usesnodeinfo.softwareand other toplevelinstancekeys (nameandfavicon). We can probably trim nodeinfo down to justversionandsoftwareby default and add a config toggle to skip trimming as a quick fix if it turns out there’s a client currently using more than that. (The config should lead to a warning likeskip_thread_containment: falsedoes. If nobody reports any issues 2 or 4 releases later we can drop the setting)This would then also address #827 but overall a bunch of duplication remains making this still rather bloated.
Ideally (well, as ideal as it can be with this conflict already in place) all clients will slowly migrate to the Mastodon format allowing us to eventually drop one copy.