Skip to content

Try to get back todo's cache or at least avoid hitting the database

Paco Guzman requested to merge 20842-todos-queries-cache into master

What does this MR do?

Use user todos counter cache on the todos badges.

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

After the creation or update of any todo we recalculate the user todos counter cache to keep it up to date. The cache can be stale if the number of projects that the user can have todos changes, we don't keep that in the cache because is too complex, and when the user will receive a new todo or update another will we rsync. Those todos won't be shown to the user on the list other but the user can notice the numbers are not in sync from some time.

I decided to test the caching functionality tagging some specs with the :caching option recently added to enable caching on specific specs

Why was this MR needed?

What are the relevant issue numbers?

Closes #20842 (closed)

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

Merge request reports