Skip to content

fix(arraystore): Fix arraystore behaviour for collection like fields (T1334552) - #34991

Open
ajivanyandev wants to merge 2 commits into
DevExpress:mainfrom
ajivanyandev:fix/arraystore-set-push
Open

fix(arraystore): Fix arraystore behaviour for collection like fields (T1334552)#34991
ajivanyandev wants to merge 2 commits into
DevExpress:mainfrom
ajivanyandev:fix/arraystore-set-push

Conversation

@ajivanyandev

Copy link
Copy Markdown
Contributor

No description provided.

@ajivanyandev ajivanyandev self-assigned this Aug 31, 2026
Copilot AI lite review requested due to automatic review settings August 31, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes ArrayStore push-update behavior when records contain collection-like fields (e.g., Set/Map) by preventing “broken clones” during deep-extend/cloning operations and adding coverage to catch regressions.

Changes:

  • Add isCollectionLike detection and treat Set/Map/weak collections as assign-by-reference in deepExtendArraySafe.
  • Avoid cloning collection-like instances during ArrayStore immutable update cloning.
  • Add regression tests in both QUnit (ArrayStore) and Jest (object utils).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/devextreme/testing/tests/DevExpress.data/storeArray.tests.js Adds a QUnit regression test verifying push(update) keeps Set fields usable after update.
packages/devextreme/js/__internal/data/m_array_utils.ts Skips cloning for collection-like instances during immutable update preparation.
packages/devextreme/js/__internal/core/utils/m_object.ts Introduces isCollectionLike and updates deep-extend logic to return collection-like objects by reference.
packages/devextreme/js/__internal/core/utils/tests/m_object.test.ts Adds Jest coverage ensuring Set/Map are assigned by reference (not cloned/broken).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +17 to +20
const isCollectionLike = function (value: unknown): boolean {
return value instanceof Set || value instanceof Map
|| value instanceof WeakSet || value instanceof WeakMap;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants