Stale client-side cache for code editor can lead to data loss after publishing code components

Created on 26 February 2025, 11 days ago

Overview

When a code component is published, the auto-saved version now gets deleted thanks to 🐛 Deleting a content entity should clear its values from the auto-save store Active . This means the code editor will load the canonical source of the config entity the next time it's used. The client-side cache will return a stale version when that happens. If that gets auto-saved, data loss occurs.

Bonus cache invalidation issue while we're here:
Deleting a previously auto-saved and not yet published code component, then creating a new one with the same name (machine name) will bring back the auto-saved version.

Proposed resolution

  1. Invalidate query cache for the code component config entity canonical source when code components are published.
  2. Invalidate query cache for the code component auto-save entry and config entity canonical source when code components are deleted.
🐛 Bug report
Status

Needs work

Version

0.0

Component

Page builder

Created by

🇳🇱Netherlands balintbrews Amsterdam, NL

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024