Skip to content

Fix false positive changes for generated columns by updating snapshop#12384

Open
podoko wants to merge 2 commits into
doctrine:3.6.xfrom
podoko:fix-GH12017-update-snapshot
Open

Fix false positive changes for generated columns by updating snapshop#12384
podoko wants to merge 2 commits into
doctrine:3.6.xfrom
podoko:fix-GH12017-update-snapshot

Conversation

@podoko

@podoko podoko commented Mar 1, 2026

Copy link
Copy Markdown

After persisting or updating an entity having columns with the configuration generate: 'ALWAYS', the persister was updating the data on the entity but not notifying the UnitOfWork. This led the entity to be considered dirty in subsequent flushes, triggering lifecycle events. This was especially noticeable when the database field was mapped to a DateTime

This PR makes the persister update the UnitOfWork with the new values from the database. By doing this, UnitOfWork::computeChangeSet does not consider these fields as different from the ones in the database.

Note that if the user does something like $entity->nonUpdatableField = 'new value', the unit of work will again consider the entity as dirty and the field appear in the changeSet. This problem is addressed in #12385

Fixes #12017

@podoko podoko force-pushed the fix-GH12017-update-snapshot branch from a3b2e05 to 6901634 Compare March 2, 2026 22:51
@podoko

podoko commented Mar 2, 2026

Copy link
Copy Markdown
Author

I upgraded the tests in order for them to run with dbal 3.7

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
If you want to continue working on it, please leave a comment.

@github-actions github-actions Bot added the Stale label Jun 1, 2026
@podoko

podoko commented Jun 1, 2026

Copy link
Copy Markdown
Author

I am still working on it

@github-actions github-actions Bot removed the Stale label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated columns with insertable/updatable=false cause false positive change detection

1 participant