GET /api/v1/statuses/{id} answers "reactions": [] for a post that has reactions
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
- Domain
- backend-api-design
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
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):
- Post as alice, then
POST /api/v1/statuses/{id}/reactwithemoji=🎉(200). GET /api/v1/timelines/home: the post has"reactions": [{"name":"🎉","count":1,"me":true}].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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/social
All issues in nextcloud/social
Similar issues
-
Recognise PHP_CodeSniffer (`phpcs`) as a linterPossibly taken @HarshRajSinghania claimed this today. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MustacheCase/zanadir#507 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jwage/phpamqplib-messenger#163 ·
-
Newsletter subscription page logs Undefined array key "nw_error" on every GETPossibly taken @Codencode claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
PrestaShop/ps_emailsubscription#145 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100