GET /api/v1/statuses/{id} answers "reactions": [] for a post that has reactions

Closed Beginner friendly
#2,595 0 comments 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #2617 by @karlitschek — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php

Research direction

Read the single-status route and compare its export path with the timeline path that uses ReactionSummaryService and setReactions(). Check how the route builds the status and its context, then run the API tests covering GET /api/v1/statuses/{id} and context responses. Done means the single status and context statuses include their reaction summaries, consistent with timeline and reactions endpoint responses.

Written by the indexing model from the issue text.

Description

backend bug

What happens

Emoji reactions show on a post in timelines but not when the post is fetched alone. GET /api/v1/statuses/{id} answers "reactions": [] for a post that has reactions. The same post in GET /api/v1/timelines/home, and GET /api/v1/statuses/{id}/reactions, show them.

To reproduce

On 0.26.181 (caa772681):

  1. Post as alice, then POST /api/v1/statuses/{id}/react with emoji=🎉 (200).
  2. GET /api/v1/timelines/home: the post has "reactions": [{"name":"🎉","count":1,"me":true}].
  3. GET /api/v1/statuses/{id}: the same post has "reactions": [].

Cause, as far as I can tell

Timelines fill reactions through ReactionSummaryService, which calls setReactions() on each post of a page. The route that serves a single status does not do this, so Stream::exportAsLocal() exports the empty default.

Proposal

Fill the reactions of the single status the same way, and of the statuses in context too. A client that opens a post from a link or a notification otherwise shows it without its reactions, and the thread view disagrees with the timeline it was opened from.

Dominant language
PHP
Stars
499
Forks
59
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/social

All issues in nextcloud/social

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.