Fix row data update workflow to properly trigger cells update events of uninitialized cells (#4723) #4793
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4723
This PR fixes the issue #4723 (which I opened myself a few months back).
Disclaimer: this is my first contribution to this repository.
Root cause analysis
The issue occurs in the case of non-rendered rows for which the row
initializedstate is false. In that case, during the execution of the methodRow.updateData, the call toRow.getCelltriggersRow.generateCellsusing the row which has already been updated with the new data.In most cases, the current behavior is not an issue because the generated cells immediately get the updated value and everything looks fine. However, if there are callbacks registered on the cells update events, they do not get triggered. That's the case for mutators.
Fix proposal
My proposal is to compute the list of cells to update prior to updating the row data, which results in cells being generated with the initial row values, and then to update the row data followed by the processing of the computed cells.
I ran all existing tests locally and they all passed. I initially wanted to update the unit tests but there doesn't seem to be tests for the
Rowclass.