Deleted (code) components can still be referenced by folders: dependency handling is missing
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3591130. --> Reported by: [bnjmnm](https://www.drupal.org/user/2369194) Related to !1133 !1135 >>> <h3 id="overview">Overview</h3> <p>Received a report that after renaming some components and pushing them to the site via CLI resulted in a folder operations not completing. Some console output was shared and I'll include some highlights:</p> <pre>&nbsp;PATCH https://174207-c06b95bd-28da-4faf-add8-41ec7f499b82.cms.acquia.site/canvas/api/v0/config/folder/0457e657-54f5-4b9a-8344-5ec6958a37f3 422 (Unprocessable Content)<br>lte @ index.js?v=1.3.3:433</pre><pre>index.js?v=1.3.3:2553 RTK Query error:&nbsp;<br>{status: '422', errors: {&hellip;}, message: "The 'canvas.component.js.media-feature-grid' config does not exist."}</pre><h3 id="proposed-resolution">Proposed resolution</h3> <p>When a "rename" occurs, it's actually a delete + create. A folder that contains the now-deleted component is never made aware of this deletion. If an operation is performed on the folder, it will fail the <code>ConfigExists</code> constraint if any item in the folder does not exist.</p> <p>This suggests we should, on component deletion, also remove it from any folder it might be in.</p> <h3 id="ui-changes">User interface changes</h3> > Related issue: [Issue #3539729](https://www.drupal.org/node/3539729)
issue