Skip to content

Clear partial-load tracking when detaching or deleting entities - #12793

Open
beberlei wants to merge 1 commit into
doctrine:3.8.xfrom
beberlei:GH-12784-detach-partial-loaded-fields
Open

beberlei wants to merge 1 commit into
doctrine:3.8.xfrom
beberlei:GH-12784-detach-partial-loaded-fields

Conversation

@beberlei

Copy link
Copy Markdown
Member

UnitOfWork::$partialObjectLoadedFields is keyed by spl_object_id(), but was not cleaned up on detach() or after a deletion was flushed. Once the object was released, PHP could reuse its object id for a new entity, which then inherited the stale entry and got spurious updates scheduled.

Fixes #12784

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Note

Greptile reviews are for Doctrine maintainers as a first filter, do not start fixing all the issues immediately unless you think they make sense. A maintainer will give you a green light on this PR for further development or rejection.

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Clears partialObjectLoadedFields when an entity is detached or its deletion is flushed.

  • Detached and deleted entities leave no partial-load tracking behind.

Reviews (1) · Last reviewed commit: "Clear partial-load tracking when detachi..." · Reviewed by Greptile

UnitOfWork::$partialObjectLoadedFields is keyed by spl_object_id(), but
was not cleaned up on detach() or after a deletion was flushed. Once the
object was released, PHP could reuse its object id for a new entity,
which then inherited the stale entry and got spurious updates scheduled.

Fixes doctrine#12784

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@beberlei
beberlei force-pushed the GH-12784-detach-partial-loaded-fields branch from f509c88 to a10e505 Compare November 15, 2026 18:56
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.

Detaching native lazy objects leaves stale partial-loading state

1 participant