You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uap-universe
changed the title
State of LocalDataSource during handling of CreateConfirm event inconsistent - depending on whether the array was empty
State of array used in a LocalDataSource during handling of CreateConfirm event inconsistent - depending on whether the array was empty
Dec 12, 2024
uap-universe
changed the title
State of array used in a LocalDataSource during handling of CreateConfirm event inconsistent - depending on whether the array was empty
LocalDataSource is inconsistent with keeping a reference to the loaded array
Dec 13, 2024
The
LocalDataSource
usually keeps a reference to the array of data that was loaded:angular2-smart-table/projects/angular2-smart-table/src/lib/lib/data-source/local/local.data-source.ts
Lines 16 to 26 in 51d46a5
However, the operations on that array are totally inconsistent.
In the
prepend
,append
, andadd
case, the elements are added to the referenced array:angular2-smart-table/projects/angular2-smart-table/src/lib/lib/data-source/local/local.data-source.ts
Lines 22 to 46 in 51d46a5
However, in the
remove
orempty
case, the reference to the original array gets overwritten:angular2-smart-table/projects/angular2-smart-table/src/lib/lib/data-source/local/local.data-source.ts
Lines 48 to 49 in 51d46a5
angular2-smart-table/projects/angular2-smart-table/src/lib/lib/data-source/local/local.data-source.ts
Lines 94 to 95 in 51d46a5
The solution to this would certainly be to not keep a reference to the original array in any case and always work on an own copy.
However, this will most likely break applications which in one way or the other rely on the current, inconsistent, behavior.
The text was updated successfully, but these errors were encountered: