Add stub endpoints for trends and suggestions#427
Open
vigneshakaviki wants to merge 1 commit intofedify-dev:mainfrom
Open
Add stub endpoints for trends and suggestions#427vigneshakaviki wants to merge 1 commit intofedify-dev:mainfrom
vigneshakaviki wants to merge 1 commit intofedify-dev:mainfrom
Conversation
Mastodon clients (including the official iOS app) expect the trends and suggestions endpoints to return empty arrays rather than 404. Without these stubs, the iOS app throws "The data couldn't be read" errors when navigating to Search or certain timelines. Added endpoints: - GET /api/v1/trends (alias for /trends/tags) - GET /api/v1/trends/tags - GET /api/v1/trends/statuses - GET /api/v1/trends/links - GET /api/v1/suggestions - GET /api/v2/suggestions All return empty JSON arrays for now, matching the behavior of Mastodon instances that have no trending data or suggestions. Ref fedify-dev#421
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's happening
The official Mastodon iOS app (and likely other clients) hits several endpoints that Hollo doesn't implement yet —
/api/v1/trends/*and/api/v{1,2}/suggestions. Right now these return 404, which causes the iOS app to throw "The data couldn't be read because it is missing" errors when you open the Search tab or navigate around.Mastodon servers that simply don't have any trending data or suggestions still return
200with an empty array — clients depend on this.What this changes
Added stub endpoints that return
[]:GET /api/v1/trends(alias for/trends/tags)GET /api/v1/trends/tagsGET /api/v1/trends/statusesGET /api/v1/trends/linksGET /api/v1/suggestionsGET /api/v2/suggestionsThis follows the same pattern already used for
/api/v1/announcements.Testing
tsc— passesbiome check— passesRef #421