- Issue created by @plopesc
- Merge request !211Issue #3436937: Navigation Bar implementation makes all pages uncacheable → (Merged) created by plopesc
- 🇪🇸Spain plopesc Valladolid
As part of the MR creation, commented the line suggested by @m4olivei in 📌 Add tests for UserNavigationBlock Needs work .
It lead to some broken tests.
Debugged it a it and found the issue in
NavigationBlockCacheTest::testCachePermissions
Cache tags before the change (Test pass):
config:block_list config:navigation.navigation_block.administration_menu config:navigation.navigation_block.content_menu config:navigation.navigation_block.oxaw6wfu config:navigation.navigation_block.user config:navigation.settings config:system.menu.admin http_response navigation_block_view rendered user:2 user_view
Cache tags after the change (Test fails):
config:block_list config:navigation.navigation_block.administration_menu config:navigation.navigation_block.content_menu config:navigation.navigation_block.user config:navigation.settings config:system.menu.admin http_response navigation_block_view rendered user:2 user_view
I'm missing the cache tag related to the test navigation block added during
setup()
.My feeling is that reason behind failing test is that navigation bar cache tags are not properly invalidated or refreshed when a new navigation block is added.
More digging in this one will be necessary. I'll try to continue with this next if anybody finds the root cause before.
- Status changed to Needs review
9 months ago 6:07am 1 April 2024 - 🇪🇸Spain plopesc Valladolid
MR created that replaces the problematic user cache context with user.permissions to make the navigation bar cacheable.
As a secondary effect, we found that cache tags were not being implemented properly because navigation bar was not including automatically new navigation blocks added.
Root cause seemed to be that navigation block list cache tag (
config:navigation_block_list
) was not included in the bar itself.Once the cache tag is added, tests are back to green and 'X-Drupal-Dynamic-Cache' header is not 'UNCACHEABLE' anymore.
I believe this is ready for review now!
- Status changed to RTBC
9 months ago 12:40pm 1 April 2024 - 🇨🇦Canada m4olivei Grimsby, ON
Great work!
That all makes logical sense to me. Ran through some tests on Tugboat, and it appears to be working well as well.
-
m4olivei →
committed cc02ac59 on 1.x authored by
plopesc →
Issue #3436937 by plopesc, m4olivei: Navigation Bar implementation makes...
-
m4olivei →
committed cc02ac59 on 1.x authored by
plopesc →
- Status changed to Fixed
9 months ago 1:21pm 1 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.