Skip to content

KeyValueDiffers infinite loop when properties order change #14997

@ghetolay

Description

@ghetolay

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request

Current behavior
When you change an object by a new object with properties on a different order an infinite loop may occur.

Expected behavior
Nobody wants an infinite loop :)

Minimal reproduction of the problem with instructions
You can easily see it using ngStyle an swapping between :

{
  width: '10px',
  height: '20px'
};

and

{
  height: '30px',
  width: '20px'
};

Here is a plunker doing just that : https://plnkr.co/edit/nRYa2aNydsKOYS8eaDEq

This is affecting both 2.4.9 and 4.0.0-rc.2 (you can easily swap version on the plunker inside config.js).

I'll reference that previous issue #9115 which is different but still about KeyValueDiffers and properties order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: commonIssues related to APIs in the @angular/common packagearea: coreIssues related to the framework runtimeregressionIndicates than the issue relates to something that worked in a previous versiontype: bug/fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions