- Issue created by @mstrelan
- 🇨🇭Switzerland berdir Switzerland
To summarize the slack discussion we just had. that those cache contexts are there on the page level isn't really relevant, they must always be there on each element that's cached separately.
The code is wrong as it replaces existing cacheability info from $build, which could cause very weird caching issues if the node is rendered in a different theme or isn't invalidated properly for cache tags and contexts that get lost.
And, if those two are the only things it adds, it can be removed entirely because both display and the node are already considered cache dependencies.
So the change is that subtle, hard to track down cache bugs are replaced with an exception.
- Status changed to Closed: works as designed
12 months ago 1:32am 8 January 2024 - 🇳🇱Netherlands casey
I think we should either merge any existing cache metadata on the renderable, like the patch in #5,
or throw an exception if the CacheableMetadata removes any existing cache metadata when applied to a renderable (diffing the new resulting #cache with the old existing ##cache)
- 🇺🇸United States moshe weitzman Boston, MA
I agree that applyTo() is a gotcha. The merge or the Exception sound good to me.
- Status changed to Needs review
6 months ago 7:31am 14 June 2024 - 🇳🇱Netherlands timohuisman Leiden, Netherlands
It sounds like we can reopen this issue as a feature request? The patch in #5 contains the suggested merge. I think the merge would be the most logical solution, because the name applyTo doesn't suggest that it overwrites the existing data.
- Status changed to Needs work
6 months ago 7:44am 14 June 2024 The Needs Review Queue Bot → tested this issue.
While you are making the above changes, we recommend that you convert this patch to a merge request → . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)
- 🇳🇱Netherlands timohuisman Leiden, Netherlands
timohuisman → changed the visibility of the branch 3412444-make-cacheablemetadataapplyto-merge to hidden.
- Status changed to Needs review
6 months ago 7:54am 14 June 2024 - Status changed to Needs work
6 months ago 7:13pm 17 June 2024 - 🇺🇸United States smustgrave
Can the issue summary be completed please.
Have not reviewed but ran test-only feature which confirms test coverage.
- 🇸🇪Sweden erik.erskine
I've updated the issue summary to attempt to better describe this feature request.