Domain decorations collide with change on larger scale caused by core issue fix

Created on 28 May 2024, 28 days ago
Updated 29 May 2024, 28 days ago

Regarding comment #25 πŸ› Container compile crash when a service decorates a destructable service Needs work in core issue πŸ› Container compile crash when a service decorates a destructable service Needs work we need 2 new issues for Domain regarding changes happening in Drupal core 10.3. One of it is this here regarding these decorations:

  domain.route_provider:
    class: Drupal\domain\Routing\DomainRouteProvider
    decorates: router.route_provider
    decoration_priority: 10

  domain_config.library.discovery.collector:
    decorates: library.discovery.collector
    class: \Drupal\domain_config\DomainConfigLibraryDiscoveryCollector

  domain_config_ui.factory:
    class: Drupal\domain_config_ui\Config\ConfigFactory
    decorates: config.factory

Possibly falling into an issue caused by πŸ“Œ Allow needs_destruction services to run on page cache hits Needs review happening to many contrib projects, like stated in the comment #29 πŸ“Œ Allow needs_destruction services to run on page cache hits Needs review by dpi at this issue, who also created the follow up stated in the beginning.

While working on this issue it is important to track changes in πŸ› Container compile crash when a service decorates a destructable service Needs work where core tries to fix/work around for contrib.

πŸ“Œ Task
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany diqidoq Berlin | Hamburg | New York | London | Paris

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

Comments & Activities

  • Issue created by @diqidoq
  • πŸ‡©πŸ‡ͺGermany diqidoq Berlin | Hamburg | New York | London | Paris
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    domain.route.provider seems to be fine.

    domain_config.library.discovery.collector will hit this because it extends Drupal\Core\Cache\CacheCollector which calls the DestructableInterface

    domain_config_ui.factory seems to be fine.

  • Status changed to Postponed: needs info 28 days ago
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    I don't think we have an issue here. I could not replicate the bug by clearing the cache.

    That is likely because of the inheritance on the service:

    domain_config.library.discovery.collector:
        decorates: library.discovery.collector
        class: \Drupal\domain_config\DomainConfigLibraryDiscoveryCollector
        arguments: ['@cache.discovery', '@lock', '@library.discovery.parser', '@theme.manager']
        tags:
          - { name: needs_destruction }
        calls:
          - [setDomainNegotiator, ['@domain.negotiator']]
    
    class DomainConfigLibraryDiscoveryCollector extends LibraryDiscoveryCollector {}
    
    class LibraryDiscoveryCollector extends CacheCollector {}
    
    abstract class CacheCollector implements CacheCollectorInterface, DestructableInterface {}
    

    CacheCollector::destruct() method is inherited by our class.

  • Status changed to Closed: cannot reproduce 28 days ago
  • πŸ‡©πŸ‡ͺGermany diqidoq Berlin | Hamburg | New York | London | Paris

    Same here. Tests with and without cache do not do anything on this. I just did not had time to test it yesterday no more. That are good news!

    For rerference: I created this issue based on the worries raised in core issue πŸ› Container compile crash when a service decorates a destructable service Needs work affecting many contrib and regarding your comment in #25

    Yes, the domain issue here is actually https://www.drupal.org/node/3425054 β†’ -- though we still need to check these decorations:

    domain.route_provider:
    class: Drupal\domain\Routing\DomainRouteProvider
    decorates: router.route_provider
    decoration_priority: 10

    domain_config.library.discovery.collector:
    decorates: library.discovery.collector
    class: \Drupal\domain_config\DomainConfigLibraryDiscoveryCollector

    domain_config_ui.factory:
    class: Drupal\domain_config_ui\Config\ConfigFactory
    decorates: config.factory

    Those should be two issues in the Domain queue.

    like described in the summary. Since so many contrib has been affected by this it was good that we made sure not being in row with this. So we got off lightly with that core issue affecting so many contrib.

Production build 0.69.0 2024