Participable#participants is called twice when viewing an issue/MR
This method is called twice when viewing an issue or merge request:
- Once to get the list of participants
- Once to check if you're subscribed to the Issuable
This results in 2 calls to:
- Get all the documents from Redis
- Parse them to HTML
- Extract the users from them
- Check if the users have access to the current project
Probably the easiest way is to:
- Move the logic of
#participants
into#raw_participants
- Have
#participants
call#raw_participants
and memoize the output in a Hash with the key being the supplied user object (since the participants returned depend on the given user)