Closed davwheat closed 2 years ago
I've not run it locally, but I think it'll be ok from a performance perspective. At the very least it won't be much of a performance hit, as the same data is added to the DiscussionSerializer
anyway. BasicDiscussionSerializer
is used far less generally.
My only question is, do we need to add the same data to both serializers, or does DiscussionSerializer
inherit the data already added by BasicDiscussionSerializer
? From memory, I think it does, but if you have it locally it would be worth a quick double check, as we could remove the additional extender call?
Changes proposed in this pull request: When displaying the vote box next to discussions in the DiscussionList, sometimes vote info does not update when clicking to toggle a vote. This is because it pulls data from
discussion.votes
rather thandiscussion.firstPost.votes
, whileUpdatePostController
(which handles the vote setting) only returns a basicly-serialized discussion as an included model in the API response, meaning that the vote count on the discussion itself does not get updated in the frontend.Reviewers should focus on:
What performance impact does this bring? Is it significant?
Confirmed
composer test
).