Breeze 1.4.8 Bug: query MergeStrategy.OverWriteChanges Never notifica mai EntityChanged o haschanges
-
21-12-2019 - |
Domanda
Quando requeerò la mia unica entità sporca con la mergeStrategy.overWriteChanges, il manager dice che gli haschanges è vero, anche se l'EntityState è invariato.Questo perché l'EntityChanged & Haschanganged non sono mai pubblicati.
Guardando la fonte in mergeentità (linea 14258) Il codice previsto per questo non funzionerà mai in quanto sta provando lo stato dell'entità dopo che è stato aggiornato e il test per l'esistenza della funzione islancata non è il valore di ritorno.
Penso che dovrebbe essere qualcosa come
if (mergeStrategy === MergeStrategy.OverwriteChanges
|| targetEntityState.isUnchanged()) {
var isTargetEntityStateUnchanged = targetEntityState.isUnchanged();
...
// this is needed to handle an overwrite of a modified entity with an unchanged entity
// which might in turn cause _hasChanges to change.
if (!isSaving && !isTargetEntityStateUnchanged) {
em._notifyStateChange(targetEntity, false);
}
. Soluzione
A partire da BREZE 1.4.9 (o successivi), disponibile ora, questo è stato risolto.E grazie per averlo trovato.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow