Skip to content

Work around a hard-to-understand failure in `CacheMarkdownField`

Nick Thomas requested to merge (removed):backport-md-cache-fix into master

What does this MR do?

As seen in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1708#note_28144576 , there is a strange interaction between the before_save callback of CacheMarkdownField and Elasticsearch::Model.

This MR works around the problem by switching our code to use before_create and before_update instead, which is functionally the same, but doesn't break Elasticsearch::Model

Are there points in the code the reviewer needs to double check?

I'd love to get to the bottom of this, but I don't want it to hold up Monday's CE->EE merge any longer.

Does this MR meet the acceptance criteria?

Merge request reports