Cache isn't invalidated by a counter cache update
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start in activerecord/lib/active_record/counter_cache.rb, especially the update_counters and reset_counters methods linked in the issue, and trace how IdentityCache observes record changes. Confirm the counter-cache paths do not invalidate the associated record cache, then add coverage showing that both counter updates and resets invalidate it.
Written by the indexing model from the issue text.
Description
The counter_cache belongs_to option is implemented using update_all, which is done on the models update_counters and reset_counters class methods. Because these don't trigger an after_commit callback, we end up not invalidating the cache for the record.
- Dominant language
- Ruby
- Stars
- 2k
- Forks
- 174
- Avg merge
- 13m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/identity_cache
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Shopify/identity_cache#568 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Shopify/identity_cache#555 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Shopify/identity_cache#539 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Shopify/identity_cache#535 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Shopify/identity_cache#533 · 1 comment ·
All issues in Shopify/identity_cache
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100