Use cached markdown fields for calculating participants
Participable#participants
gets the participants for an object (issue, merge request, etc.). It does this by looking at the rendered HTML of the object and any notes, then extracting references to users.
We cache the rendered HTML of objects (including notes) in the database. This #participants
method does not use that, however, but its own Redis-backed cache. This means that we are using two caches instead of one, which is dumb, but in this case the database is better as we've already loaded the *_html
field from the database.
This ends up calling Banzai::Renderer.cache_collection_render
, which we could teach to be aware of cached database fields. Or we could update Participable
and Mentionable
to improve those. Or both!