How can I get a key for a fetch_by_some_attribute([a, b]) if the result is nil?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
Research direction
Start by reading the README warning about stale data, then trace Model.fetch_by_some_attribute(['green', 'red']) and the IdentityCache.cache.clear(some_key) path. Determine whether nil results should be invalidated or whether callers need a way to obtain the cache key, and define tests that demonstrate the chosen behavior.
Written by the indexing model from the issue text.
Description
So I'm running into stale data issues as per the warning in the readme.
I would like to just invalidate / not even store the result if a fetch_by_some_attribute returns nil.
Failing that, I would like to invalidate the cache by doing IdentityCache.cache.clear(some_key).
But how do I get the key from
Model.fetch_by_some_attribute(['green', 'red'])
if it returns nil?
- Dominant language
- Ruby
- Stars
- 2k
- Forks
- 175
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ublue-os/homebrew-experimental-tap#774 ·
Maintainers usually reply within 1 day
-
accessibility
Difficulty 1/5 Under an hour Newbie friendliness 72/100
slovensko-digital/ops-portal#212 ·
Maintainers usually reply within 1 day
-
Local evaluation buckets percentage splits with the server key, so results differ from FlagsmithOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Add PrestashopOpenrequest
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
endoflife-date/endoflife.date#11303 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100