Skip to content

Collections data loaded twice when using EAGER loading in combination with iterables #11081

@bobvandevijver

Description

@bobvandevijver

Bug Report

Q A
BC Break yes
Version 2.17.0/2.17.1

Summary

With #8391 optimisations where added with relation to eager loading collections. However, the eager load of the collection is not triggered when using an iterable result, causing the collection to be hydrated twice when actually accessed.

Current behavior

When an uninitialised collection within an entity coming from a iterable result is hit, it will trigger its load. However, this load also triggers the unit of work to process the stored eagerly loaded collection to load, resulting in the collection being loaded twice: it will contain duplicate items.

How to reproduce

See the added test, and proposed fix in #11082.

Expected behavior

The collection should not contains each item twice. I believe the eager load for the collection should be skipped by the UoW as it is already being loaded at that time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions