Propagate synchronize flag when profiles are updated in postSave

Created on 29 July 2025, 3 days ago

Problem/Motivation

When a Profile entity is modified within its own postSave() method, the isSyncing state is not correctly propagated.
This leads to unexpected behavior when profile updates indirectly trigger configuration changes or other entity updates that rely on isSyncing to avoid recursive or unintended operations.

In other words, during profile save operations initiated as part of a config import or other syncing process, follow-up changes triggered in postSave() may still execute logic that should be suspended when isSyncing is TRUE.

This can result in:

- Configuration updates running during sync operations
- Unwanted hooks or side effects triggering
- Potential infinite loops or partial updates during imports

Steps to reproduce

- Implement hook_ENTITY_TYPE_presave() or hook_ENTITY_TYPE_update() on profile that triggers a config or entity update.
- Save a profile entity as part of a config import or other syncing process where $entity->isSyncing() should be TRUE.
- In postSave(), trigger a change that causes another entity/config to update.
- Observe that isSyncing is not correctly propagated to the triggered operations.

Proposed resolution

Ensure that the isSyncing flag is correctly maintained during the postSave() phase for Profile entities.

Remaining tasks

- Add test coverage to confirm isSyncing is respected during postSave() operations.
- Update Profile::postSave() to propagate the flag correctly.

User interface changes

None.

API changes

- Internal behavior of Profile::postSave() adjusted to ensure isSyncing is respected.
- No changes to the public API.

Data model changes

None.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇳🇴Norway zaporylie

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