Skip to content

Add stub endpoints for trends and suggestions#427

Open
vigneshakaviki wants to merge 1 commit intofedify-dev:mainfrom
vigneshakaviki:fix/stub-trends-and-suggestions-endpoints
Open

Add stub endpoints for trends and suggestions#427
vigneshakaviki wants to merge 1 commit intofedify-dev:mainfrom
vigneshakaviki:fix/stub-trends-and-suggestions-endpoints

Conversation

@vigneshakaviki
Copy link
Copy Markdown

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 200 with 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/tags
  • GET /api/v1/trends/statuses
  • GET /api/v1/trends/links
  • GET /api/v1/suggestions
  • GET /api/v2/suggestions

This follows the same pattern already used for /api/v1/announcements.

Testing

Ref #421

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant