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.

Issue fork profile-3538535

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

zaporylie created an issue. See original summary.

zaporylie’s picture

Version: 4.0.x-1.x-dev » 8.x-1.x-dev

zaporylie changed the visibility of the branch 3538535-propagate-synchronize-flag to hidden.

zaporylie’s picture

Status: Active » Needs review

jsacksick made their first commit to this issue’s fork.

  • jsacksick committed abe241f4 on 8.x-1.x authored by zaporylie
    [#3538535] feat: Propagate synchronize flag when profiles are updated in...
jsacksick’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.