Destination Param causes Leaked Metadata

Created on 17 September 2024, 2 months ago
Updated 18 September 2024, 2 months ago

Problem/Motivation

I've recently started noticing some "leaked cacheability metadata" in the logs for my sites. I read through some of the documentation and it mentioned ->toString(TRUE) and attaching the cache data to a CacheableRedirectResponse or using Symfony RedirectResponse and not dealing with it at all. I tried both options and was still getting the warning. After removing the Destination and using one of the suggested fixes the issue seems to go away.

Next I tried this with a Standard Drupal Site install with the only extra module being SAML Authentication. I created a page with a login link with a destination back to /node in content (/saml/login?destination=/node) and was still getting the leaked metadata warning. Is there something I need to configure to resolve this issue?

I noticed in the code that when the destination url is generated it doesn't use ->toString(TRUE), but I wasn't sure if the cache data for that was handled elsewhere or just ignored since a custom render context is used.

πŸ’¬ Support request
Status

Active

Version

3.10

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States EJSeguinte

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @EJSeguinte
  • πŸ‡³πŸ‡±Netherlands roderik Amsterdam,NL / Budapest,HU

    Next I tried this with a Standard Drupal Site install with the only extra module being SAML Authentication. I created a page with a login link with a destination back to /node in content (/saml/login?destination=/node) and was still getting the leaked metadata warning.

    That's very interesting. That really points to this module doing something wrong (as opposed to the 'fault' being in code that is being called in contrib code by e.g. a hook, as is the case in #3232577: Code leaked cacheability metadata β†’ ). Thank you for checking.

    I should really reproduce this and check. (And also check, what exactly the πŸ“Œ Exception in EarlyRenderingControllerWrapperSubscriber is a DX nightmare, remove it Needs work fix is that went into Drupal Core after nine years of stalling, and how it affects the necessity for this warning.)

    ("when I get the time" (TM))

Production build 0.71.5 2024