#3591917 Array prop shapes inherit their item shape's cache tags

Closes #3591917 (closed)

What this MR does

Makes array (type: array) prop shapes inherit the cache tags of their item prop shape. EphemeralPropShapeRepository now collects the cacheability of every prop shape resolved while computing another one and merges it into the outer candidate before the alter hooks run, so PersistentPropShapeRepository stores array entries with tags like config:media_type_list and tag invalidation re-resolves them. The alternative of putting cacheability on StorablePropShape was rejected: it is an immutable value object whose content is compared (fieldDataFitsIn()), so tags would leak into equality semantics.

The regression test also restores the cache_tags_invalidator / needs_destruction service tags that PropShapeRepositoryTest::register() silently dropped when swapping in the test helper class — with them back, the test exercises the real MediaType-save → invalidation → destruct cycle instead of simulating it.

Testing steps

  1. On 1.x without this MR, on a site with canvas_test_sdc components generated and no image media type: create an image media type, then trigger prop-shape re-resolution (any warm request / cache-tag invalidation cycle).
  2. sdc.canvas_test_sdc.image gets a new active version (media library reference shape); sdc.canvas_test_sdc.image-gallery keeps only its old version until a full drush cr.
  3. With this MR, both get their new version in step 2. Covered by the new kernel test PropShapeRepositoryTest::testArrayPropShapeInheritsItemPropShapeCacheTags() (verified to fail without the fix), which also runs in the HookCanvasStorablePropAlter and MediaLibraryHookStoragePropAlter subclasses.

Notes for reviewers

Written with AI assistance (Claude Fable 5 / Claude Opus 4.8): investigation, fix, and regression test were AI-drafted and human-reviewed; the empirical reproduction is documented in #3591917 (closed) and #3591916.

Merge request reports

Loading