Skip to content

Conversation

@sjbur
Copy link
Contributor

@sjbur sjbur commented Jan 28, 2026

No description provided.

@sjbur sjbur self-assigned this Jan 28, 2026
@sjbur sjbur added the 26_1 label Jan 28, 2026
@sjbur sjbur marked this pull request as ready for review January 29, 2026 08:16
@sjbur sjbur requested a review from a team as a code owner January 29, 2026 08:16
Copilot AI review requested due to automatic review settings January 29, 2026 08:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a memory leak issue (T1317109) that occurs when PivotGridDataSource is reassigned. The fix ensures that internal DataSource instances within store objects are properly disposed when the PivotGridDataSource itself is disposed.

Changes:

  • Added dispose() methods to LocalStore, RemoteStore, and XmlaStore classes
  • Modified PivotGridDataSource.dispose() to call the store's dispose method
  • Added tests to verify that LocalStore and RemoteStore dispose their internal DataSource instances
  • Improved code formatting with consistent indentation in data_source.ts

Reviewed changes

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

Show a summary per file
File Description
packages/devextreme/testing/tests/DevExpress.ui.widgets.pivotGrid/dataSource_bundled.tests.js Added two tests to verify that PivotGridDataSource.dispose() properly disposes the internal DataSource in both LocalStore and RemoteStore
packages/devextreme/js/__internal/grids/pivot_grid/xmla_store/m_xmla_store.ts Added empty dispose() method to XmlaStore for interface consistency (XmlaStore doesn't maintain internal DataSource)
packages/devextreme/js/__internal/grids/pivot_grid/remote_store/m_remote_store.ts Added dispose() method that disposes the internal _dataSource using optional chaining for null safety
packages/devextreme/js/__internal/grids/pivot_grid/local_store/m_local_store.ts Added dispose() method that disposes the internal _dataSource using optional chaining for null safety; also removed unnecessary eslint-disable comment
packages/devextreme/js/__internal/grids/pivot_grid/data_source/m_data_source.ts Updated dispose() to call store's dispose method; improved code formatting with consistent indentation

Comment on lines +6920 to +6941
QUnit.test('PivotGridDataSource dispose disposes LocalStore', function(assert) {
const dataSource = new PivotGridDataSource({
store: window.orders
});
const store = dataSource.store();

dataSource.dispose();

assert.ok(store._dataSource._disposed, 'LocalStore internal DataSource is disposed');
});

QUnit.test('PivotGridDataSource dispose disposes RemoteStore', function(assert) {
const dataSource = new PivotGridDataSource({
remoteOperations: true,
store: window.orders
});
const store = dataSource.store();

dataSource.dispose();

assert.ok(store._dataSource._disposed, 'RemoteStore internal DataSource is disposed');
});
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The tests for LocalStore and RemoteStore disposal both access the internal _dataSource property to verify disposal. However, there's no corresponding test for XmlaStore disposal, even though an empty dispose() method was added to it. Consider adding a test for XmlaStore to maintain consistent test coverage across all store types, or add a comment explaining why XmlaStore doesn't need disposal testing (because it doesn't maintain an internal DataSource).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant