Add methods to `AutoSaveEntity` value object to simplify auto-save infrastructure

Created on 11 July 2025, 3 days ago

Overview

πŸ“Œ [PP-1] Enforce conflict enforcement outside of tests and e2e tests Postponed added autoSaveRevision, πŸ“Œ Convert Autosave conflict tests using AutoSaveConflictTestTrait into functional test to test caching Active renamed it to autoSaveStartingPoint.

This:

  1. lives in an odd place (AutoSaveValidateTrait::getClientAutoSaveData β€” a trait that exists only for validation purposes while it must also actually be generated & passed to the client when not validating)
  2. also lives at AutoSaveManagerTestTrait::getClientAutoSaveData()
  3. and #3535315 added additional caching complexity for it

It's all necessary complexity! πŸ‘ … but it could be organized differently, to better manage that complexity. πŸ™

Proposed resolution

We already have the \Drupal\experience_builder\AutoSaveEntity value object. But we're barely using it.

Use it for more.

User interface changes

Zero.

πŸ“Œ Task
Status

Active

Version

0.0

Component

Auto-save

Created by

πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

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

Comments & Activities

  • Issue created by @wim leers
  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

    @wim leers thanks for creating this follow-up. I started an MR on the other issue to show an similar idea https://git.drupalcode.org/project/experience_builder/-/merge_requests/1270

    I will move some of that work here

  • @tedbow opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

    I pushed up the changes I had started on the other issue.

    Instead of adding AutoSaveEntity::getLiveStartingPoint() I added AutoSaveManager::calculateStartingPoint()

    I think the starting point needs to calculated at 2 points

    1. In AutoSaveManager::saveEntity() if there is no existing auto-save entry
    2. In \Drupal\experience_builder\Controller\AutoSaveValidateTrait::getClientAutoSaveData() there is no auto-save entry
Production build 0.71.5 2024