-
Notifications
You must be signed in to change notification settings - Fork 665
PivotGrid: T1317109 — fix memory leak after PivotGridDataSource is reassigned #32332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 26_1
Are you sure you want to change the base?
Conversation
This reverts commit 8c3e610.
There was a problem hiding this 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 |
| 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'); | ||
| }); |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
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).
No description provided.