Fix caching issue in processes content block#15988
Conversation
📝 WalkthroughWalkthroughThese changes implement cache invalidation for featured processes content blocks. A Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a caching issue in the highlighted processes content block on the homepage. When a participatory process's active step changes, the cache was not being invalidated, causing the homepage to display stale step information.
Changes:
- Updated the
cache_hashmethod inHighlightedParticipatorySpacesCellto include the active step's cache key in the cache calculation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
decidim-core/app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
Show resolved
Hide resolved
alecslupu
left a comment
There was a problem hiding this comment.
I would go for another approach on this PR. The way is implemented now, is adding an extra query for each one of the highlighted processes in the page, just to build cache.
Why not a simple touch the Process after the Step is updated?
Oh... the only reason why I didn't do it like that is that I didn't have the idea 🤣 I applied it. I also left the specs and added a model spec to leave it documented just in case |
alecslupu
left a comment
There was a problem hiding this comment.
Better - Merging with failing pipeline on qlty.
🎩 What? Why?
As explained on #15963, there's a caching issue in the "Highlighted Processes" content block of the homepage.
📌 Related Issues
Testing
bin/rails dev:cache📷 Screenshots
Summary by CodeRabbit
Bug Fixes
Tests