- Issue created by @mitrpaka
Manual merge conflict resolution may end up to
Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'xxx' for key 'PRIMARY': INSERT INTO "node_revision"
Conflict module expects that the entity loaded from the storage remains unchanged while conflict resolution in progress. However, user a.ka content editor is able to save new revision of the entity while manual merge conflict resolution on-going in other browser or browser tab.
If the revision for the entity loaded from the storage is greater than the locally edited entity, conflict resolution will end up to duplicate revision_id error in core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php when entity revision is being saved.
Do not have proper solution proposal for this as of now.
However, in order to prevent duplicate error to happen for content editors, you could check (before setting revision id for the locally edited entity) whether revision has changed for the entity loaded from the storage in autoMergeEntityMetadata() and flag (or resolve) revision change.
Active
Code