Fix rowTransaction memory retention while preserving pre-mount transaction buffering#456
Fix rowTransaction memory retention while preserving pre-mount transaction buffering#456
rowTransaction memory retention while preserving pre-mount transaction buffering#456Conversation
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/94022509-da2c-4214-a58e-b9c85032e29f Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
rowTransaction reference retention in the React wrapper
|
The reason this existed previously was in the event that the grid wasnt mounted, the rowTransactions would build until it was mounted and could be loaded. We need to make sure that this case still works. |
|
see above |
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/718878d8-cc62-41f8-a36b-d22d6f657dee Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/718878d8-cc62-41f8-a36b-d22d6f657dee Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/718878d8-cc62-41f8-a36b-d22d6f657dee Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Implemented and pushed a fix that preserves pre-mount
Addressed in the latest commits: pre-mount transaction buffering is restored and replayed after mount, and the replay path bug for queued transactions is fixed. Commit: |
rowTransaction reference retention in the React wrapperrowTransaction memory retention while preserving pre-mount transaction buffering
|
Fix conflicts and also add a changelog entry. Also, we need to make sure that the arr1 is not already in arr2, I guess we could do a |
…k-rowtransaction # Conflicts: # src/lib/fragments/AgGrid.react.js Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/4f1937a5-6498-482d-81f2-16935edd8811 Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/4f1937a5-6498-482d-81f2-16935edd8811 Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Done. I merged |
|
Add a test for the memory leak |
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/e16d6d2f-7afa-4b7b-b3f2-a3020bb975b4 Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/e16d6d2f-7afa-4b7b-b3f2-a3020bb975b4 Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Added a memory-leak regression check in |
There was a problem hiding this comment.
Pull request overview
Fixes rowTransaction pre-mount buffering/replay to prevent memory growth from retained transaction payloads, while preserving expected behavior when transactions arrive before the lazy-loaded grid fragment is available.
Changes:
- Reintroduces wrapper-level buffering for pre-mount
rowTransactionand adds mount handoff/cleanup. - Initializes fragment-side replay state from buffered parent transactions, adds de-duplication, and fixes replay invocation to avoid incorrect callback argument forwarding.
- Adds a regression test for pre-mount
rowTransactionbehavior and includes an unreleased changelog entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/lib/components/AgGrid.react.js |
Buffers rowTransaction before fragment mount, de-dupes queued payloads, and clears buffered state on fragment mount signal. |
src/lib/fragments/AgGrid.react.js |
Seeds queued transaction state from wrapper, replays safely, omits internal props from conversion, and adds mount signaling propTypes. |
tests/test_selection_persistence.py |
Adds regression test ensuring pre-mount transaction is applied and rowTransaction resets to null. |
CHANGELOG.md |
Adds unreleased “Fixed” entry documenting the buffering/replay + retention fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/bbbb71ee-89ae-4307-a1ed-8b20e7eda41e Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plotly/dash-ag-grid/sessions/8740a8c3-4a89-42ff-9ca1-00070ea0647b Co-authored-by: BSd3v <82055130+BSd3v@users.noreply.github.com>
rowTransactionupdates were causing memory growth because transaction payloads were retained longer than necessary.This update keeps the original pre-mount buffering behavior (needed before the lazy grid fragment is ready) while preventing stale references from accumulating.
Root cause
Changes
src/lib/components/AgGrid.react.jsfor transactions received before JS grid mount.src/lib/fragments/AgGrid.react.jsto initialize replay state from buffered parent transactions and replay them safely.forEach.rowTransactionpayloads are not buffered multiple times before mount.props.rowTransactionand buffered state are both present.tests/test_selection_persistence.py:test_sp002_row_transaction_before_grid_readyvalidates queued transaction replay, existing row integrity, androwTransactionreset tonullafter replay,test_sp003_duplicate_row_transaction_before_grid_readyvalidates duplicate pre-mount transaction payloads are buffered/applied only once.v35into this branch to resolve conflicts and added an unreleased changelog entry inCHANGELOG.md.Net effect
rowTransactionarrives before grid readiness.